I have created a macro to produce a pipe delimited text file. The macro first runs a make table query. The query contains the following field,
Expr1: "forename" & "|" & "surname" & "|" & "dateofbirth" & "|" & "postcode" & "|" & "address1" & "|" & "address2" & "|" & "address3" & "|" & "address4" & "|" & "address5" & "|" & "studentid"
This is used to create a header for the eventual text file. The macro then runs a second query which appends data to the field created above. The query contains the following Fields;
Expr1: [FORENAME] & "|" & [SURNAME] & "|" & [DATE_OF_BIRTH] & "|" & [Postcode] & "|" & [ADDRESS_LINE_1] & "|" & [ADDRESS_LINE_2] & "|" & [ADDRESS_LINE_3] & "|" & [ADDRESS_LINE_4] & "|" & [ADDRESS_LINE_5] & "|" & [studentid]
This appears to work ok, the header appears at the top of the table with the data underneath. The macro then uses TransferText to send the table to a text file. This in most cases works ok, but every now and again, the header information appears half way down the text file? Ive really no idea what could be causing this? Has anyone got any suggestions? I really need the header information at the top!
Expr1: "forename" & "|" & "surname" & "|" & "dateofbirth" & "|" & "postcode" & "|" & "address1" & "|" & "address2" & "|" & "address3" & "|" & "address4" & "|" & "address5" & "|" & "studentid"
This is used to create a header for the eventual text file. The macro then runs a second query which appends data to the field created above. The query contains the following Fields;
Expr1: [FORENAME] & "|" & [SURNAME] & "|" & [DATE_OF_BIRTH] & "|" & [Postcode] & "|" & [ADDRESS_LINE_1] & "|" & [ADDRESS_LINE_2] & "|" & [ADDRESS_LINE_3] & "|" & [ADDRESS_LINE_4] & "|" & [ADDRESS_LINE_5] & "|" & [studentid]
This appears to work ok, the header appears at the top of the table with the data underneath. The macro then uses TransferText to send the table to a text file. This in most cases works ok, but every now and again, the header information appears half way down the text file? Ive really no idea what could be causing this? Has anyone got any suggestions? I really need the header information at the top!