- Local time
- Today, 19:25
- Joined
- Sep 12, 2006
- Messages
- 16,026
glad you got it sorted - good luck with your project
out of interest
you basically have two ways to generate an external file (csv, text etc)
option 1 is to use inbuilt access facilities. just take a table or query and then either do from the menu options export, or save as (something like that - the exact menu items seem to change with each version)- or in code docmd.transfertext, or docmd.transferspreadsheet (or even maybe docmd.outputto)
this is the easier way of generating an output file - you just construct a query that contains the data you need - sort it in the way you want - and invoke a simple command, and its all done for you. Access offers you a number of facilities to help achieve the output you want. (Note that file INPUT can be achieved in a similar way, also)
option 2 is to take the same table or query, but then write code to read it in, line by line, and output it to a given text file - which is what you are doing
so this is far harder, needs more advanced programming skills, takes more code anyway, needs careful testing - but might be the only way to achieve certain non-standard outputs
eg, in this case where you need extra line feeds - you may HAVE to do the conversion manually.
out of interest
you basically have two ways to generate an external file (csv, text etc)
option 1 is to use inbuilt access facilities. just take a table or query and then either do from the menu options export, or save as (something like that - the exact menu items seem to change with each version)- or in code docmd.transfertext, or docmd.transferspreadsheet (or even maybe docmd.outputto)
this is the easier way of generating an output file - you just construct a query that contains the data you need - sort it in the way you want - and invoke a simple command, and its all done for you. Access offers you a number of facilities to help achieve the output you want. (Note that file INPUT can be achieved in a similar way, also)
option 2 is to take the same table or query, but then write code to read it in, line by line, and output it to a given text file - which is what you are doing
so this is far harder, needs more advanced programming skills, takes more code anyway, needs careful testing - but might be the only way to achieve certain non-standard outputs
eg, in this case where you need extra line feeds - you may HAVE to do the conversion manually.