Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to select records for exporting as CSV file?

Status
Not open for further replies.

TSimonick

Technical User
Sep 6, 2001
39
US
Hello,

I need to create a form (based on a query) so that the user can select certain records and then those records are exported as a CSV file. The CSV must start with a number that represents the number of records in the file, followed by 10 blank lines, then the actual records. And, a blank line after every 8 records. Pretty weird, huh?

I was planning on using a continuous form so that the user can just select the records by a clicking in a check box (unbound?) , then clicking a button to run the code to create the export fle.

I figured out the TransferText method, but would appreciate any help with the code needed to solve this problem.

Thanks in advance,

Tom
 
u can best use a combobox with multirow selected. The users now can select the necc. rows. and u can make a TempTable with the following construction
dim pos as variant
strSQL = "DELETE TempMailing.* FROM Tempmailing;"
for each pos in cbo.itemsselected
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
docmd.setwarnings true
strSQL = "Insert Into temptable([value1],..) vALUes (v1,..)
docmd.runsql sTrSQL
next pos

no u can make a recordset and play a bit around with counters and mod functions
 
Checkout,

I am new to VBA, can you explain a little more about "make a recordset and play a bit around with counters and mod functions"? This is the first time I have heard about a multi-select box, it will work well for this form!

Thanks for your help.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top