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 do I save a record with a field value as the text file name?

Status
Not open for further replies.

pcdropper

Technical User
May 8, 2001
4
CA
I've been beating my head against the wall with this one for a month now. I've been using Access for almost ten years and I'm ashamed to say I've only started using VBA since I've always been programming shy.

I'm trying to output identifiably-named text files to distribute to clients using various media from the internet and email to fax and floppy disks. I tried saving report pages as HTML but cross-referencing filename_Page293.htm, etc. is a nightmare. Any suggestions or is it even possible? I presume it's simple but I can't get it to work.

If you'd like I'll submit the modules I've written so far.
 
You can use the Text Box's Name property. Such as :

TextBox1 is the text box who's name you wish to store somewhere. You are going to store it in TextBox2 so that you can save it in a table somewhere. In the form's before update event I would have this:

TextBox2 = TextBox1.Name

I hope this is what you need. ljprodev@yahoo.com
Professional Development
MS Access Applications
 
Sorry, but this answer doesn't seem related to the question.

I'm trying to make text files with names drawn from the contents on a text field.
For example, if the field is named fldSection, and the value is "Tennis", I want
the filename to be tennis.txt, and the file contains the entire record for the
value "Tennis".

I have no desire to store the name of a Text box. Maybe you were answering
another question by mistake?
 
My sincere apologies. I totally misread your question. As I understand now, you would like to create a text file that has a filename equal to that of a field in a record and you would like that record to be contained in the file. If you would give me your email address or email me below. I can send you a sample database that has the code to do what you asked.
ljprodev@yahoo.com
Professional Development
MS Access Applications
 
Thanks dude. It worked like a charm, although I realize I could have been a lot more specific. Thanks for not only figuring it out but for making sense of my confusing question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top