PDA

View Full Version : Using Print To Output Records To Text File



mattster1010
04-28-2008, 03:56 AM
Good Morning All,

I need some help / point in the right direction as to how I would achieve the following:

I have a table called "Main" and two colums called "id_no" & "FirstName". I need to output the contents of the table per record in the following format into a text file:

send <cr>
send <numpad3>
send <numpad1>
send <numpad5>
send <numpad7>
send <numpad8>
send <numpad4>
send <numpad2>
send <do>
send <right>
send <right>
send <right>
send <cr>
send <tab>
send <tab>
send <tab>
send <tab>
send <tab>
send <tab>
send <tab>
send <tab>
send <tab>
send <tab>
send <tab>
send "Janet<do>"

The highlighted blue section represents the "id_no" field, in Access it would look like "3157842", but has to be outputted as above and would change for each record in the table. The highlighted orange section represents the "FirstName" field, in Access this would look like "Janet" for example.

The real trouble is getting each character in "id_no" to output under each other....

Can anyone help / point me in the right direction?

Cheers,

Mattster

OBP
05-02-2008, 03:57 AM
Mattster, I don't think that splitting the ID number is a real problem as this can be done easily with a query or in VBA using the Mid() function.
What I am not sure how you will accomplish is all of the rights and tabs.
Does that ID always have the same number of Characters?
If it does you can use a query with column headings like
mid([id_no], 1,1)
mid([id_no], 2,1)
etc to split it up