export form to excel

aftershokk

Registered User.
Local time
Today, 21:28
Joined
Sep 5, 2001
Messages
259
I have a form that exports to excel in datasheet view.

To run this report a user opens a form and clicks a checkbox to detremine what category of records they want to export. In other words, their is a list on the screen such as clothes, shoes, belts etc. If the user checks shoes then the underlying query/form will pull the related data and prompt the user to export to excel. THe user picks the path and keys the file name.

I want the export to go to a specified path which I know how to do but I want the file name to be dynamic. In other words the file name would be shoes.xls in this case. If the user picks clothes, then the file name would be clothes.xls etc......

I can store the value such as clothes in a field in a table but I am not sure how to call out the value to placed in the file name.

thanks experts!!
 
Can you use the name of the control?

So chkShoes and then just remove the first 3 chars and append .xls and call that the filename.
 
How is the list they choose from there? You should be able to reference

Me.YourListBoxNameHere.Column(1) for the type, if say you had a list box with shoes, clothes, etc. in there and the first column was the ID and then the second column was the text.

So, how are they choosing?
 
My categories such as shoes are stored in a table where a Yes is stored from a check box entry from the user. This table is joined to a master table on category name which has the value shoes stored in a field. Therfore, when the user picks shoes then all records (20 columns) with shoes in the category field are displayed and then it exports to excel with a fixed name. I want to take one instance of the name shoes from the category field and use this as my file name. thanks!!!
 
I think I would need to see your Db to determine the best way to do this.
 
I wish I could send it but I cannot. I prety much need VB to be able to create the file name dynamcially. Maybe based on text in another table/field?

thanks
 

Users who are viewing this thread

Back
Top Bottom