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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting to text file with variable name 1

Status
Not open for further replies.

cobweb

IS-IT--Management
May 5, 2002
95
GB
Hi Guys:
I am wanting to export an access table to a fixed length text file; but he file must have a name that refers to the contents of the table.
The first 8 characters can be fixed - say 99999999; but the 3 characters after the full stop must be the last 3 characters of the field "Orders" in the table exporting to file.

I could tell you what I have tried; but you would just laugh.

Thanks in anticipation!
 
How 'bout this:

Private Sub cmdExportToTextFile_Click()
'NOTE: This is attached to a command button
Dim strFileName as String

...

strFileName = "99999999" & Right(CStr([Orders]), 3)
Open strFileName for Output as #1

...

End Sub

That's pretty rough and answers only the file naming question. Yell if you need more....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top