Formatting a sheet after Export from access

Vergy39

Registered User.
Local time
Today, 05:37
Joined
Nov 6, 2009
Messages
109
Please help, I have wondered this forum and the internet for help with no success. I have a button on a access database form that runs a query and exports the data to an excel sheet that remains open. I am ok with this. What I would like to do now is format the sheet and then save it as a file name that is the same as the query name but adding the date at the end. Here is what I have so far:

Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Dim stDocName As String

stDocName = "Qry_SentForProcessing"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.RunSavedImportExport "Export-Qry_SentForProcessing"

Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click

End Sub


I just want to add the code to this button. Or do I need to write a function as a module, then call the function after the export is run. Any assistance is greatly appreciated.

Thanks
David V
 
Check Similar Threads at the bottom. Also, work on your search skills, because your problem is not that rare. In Google you can restrict the search to a specific site. Try it.
 

Users who are viewing this thread

Back
Top Bottom