From: jim on
Hi All,

I need to export a query to a text file but i need each field delimited
by a new line. Cant seem to find a way to do it.

any ideas..

thanks

jim
From: Mark on
Jim,

Could you clarify what you mean by "each field delimited by a new line".
Does the query return multiple records?

Steve


"jim" <jim(a)blahblah.blah> wrote in message
news:4_ednYVL_dhqs_zVnZ2dnUVZ8qPinZ2d(a)posted.metronet...
> Hi All,
>
> I need to export a query to a text file but i need each field delimited by
> a new line. Cant seem to find a way to do it.
>
> any ideas..
>
> thanks
>
> jim


From: jim on
Hi Steve,

Thanks for the reply... i have a table with username and email addresses
and i wish to output it as follows:

username1
email1

username2
email2

username3
email3

rather than:
username1, email1
username2, email2
username3, email3


cant seem to find a way to do it.... any ideas appreciated..

cheers

jim


Mark wrote:
> Jim,
>
> Could you clarify what you mean by "each field delimited by a new line".
> Does the query return multiple records?
>
> Steve
>
>
> "jim" <jim(a)blahblah.blah> wrote in message
> news:4_ednYVL_dhqs_zVnZ2dnUVZ8qPinZ2d(a)posted.metronet...
>> Hi All,
>>
>> I need to export a query to a text file but i need each field delimited by
>> a new line. Cant seem to find a way to do it.
>>
>> any ideas..
>>
>> thanks
>>
>> jim
>
>
From: Mark on
Hi Jim,

Try the following:

Dim DB As DAO.Database
Dim Rst As Recordset
Set DB = CurrentDB()
Set Rst = DB.OpenRecordset("NameOfYourTable")
Open "C:\TESTFILE.Txt" For Output As #1
Do Until Rst.EOF
Print #1, Rst!UserName
Print #1, Rst!Email
Print #1, ""
Rst.MoveNext
Loop
Close #1
Set DB = Nothing
Rst.Close
Set Rst = Nothing

Notes ....

1. In the line Open "C:\TESTFILE.Txt" For Output As #1, Change
C:\TESTFILE.Txt to wherever you wantto store your text data.
2. In the two lines, Print #1, Rst!UserName and Print #1, Rst!Email, be
sure to use the actual field names in your table

I provide users a resource for help with Access, Excel and Word
applications. My fees ar very reasonable. If you ever need help beyond what
a newsgroup can provide, please contact me at rlaird(a)penn.com.

Steve

"jim" <jim(a)blahblah.blah> wrote in message
news:fPidnT8VTODNn_nVnZ2dnUVZ8vCdnZ2d(a)posted.metronet...
> Hi Steve,
>
> Thanks for the reply... i have a table with username and email addresses
> and i wish to output it as follows:
>
> username1
> email1
>
> username2
> email2
>
> username3
> email3
>
> rather than:
> username1, email1
> username2, email2
> username3, email3
>
>
> cant seem to find a way to do it.... any ideas appreciated..
>
> cheers
>
> jim
>
>
> Mark wrote:
>> Jim,
>>
>> Could you clarify what you mean by "each field delimited by a new line".
>> Does the query return multiple records?
>>
>> Steve
>>
>>
>> "jim" <jim(a)blahblah.blah> wrote in message
>> news:4_ednYVL_dhqs_zVnZ2dnUVZ8qPinZ2d(a)posted.metronet...
>>> Hi All,
>>>
>>> I need to export a query to a text file but i need each field delimited
>>> by a new line. Cant seem to find a way to do it.
>>>
>>> any ideas..
>>>
>>> thanks
>>>
>>> jim
>>

From: Tony Toews [MVP] on
"Mark" <notmy(a)email.com> wrote
:
>I provide users a resource for help with Access, Excel and Word
>applications. My fees ar very reasonable. If you ever need help beyond what
>a newsgroup can provide, please contact me at rlaird(a)penn.com.

Steve

Soliciting for customers here too. Shame on you.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/