Microsoft Access, naming a file with text from a form field

A

Angela

Is there a way to automate the exporting of a table to an excel spreadsheet
and naming it with text from a form's field?

Thanks for any help.

ARV
 
A

Allen Browne

Try:
DoCmd.TransferSpreadsheet acExport,,"MyTable",
Me.[NameOfYourTextboxHere], True

That assumes the text box contains something like:
C:\MyFolder\MyFile.xls
 
A

Angela

Thanks Allen. You made my day. It works like a charm.

Angela

Allen Browne said:
Try:
DoCmd.TransferSpreadsheet acExport,,"MyTable",
Me.[NameOfYourTextboxHere], True

That assumes the text box contains something like:
C:\MyFolder\MyFile.xls

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Angela said:
Is there a way to automate the exporting of a table to an excel
spreadsheet and naming it with text from a form's field?
 
Top