Export Excel file but first ask for date range

hardhitter06

Registered User.
Local time
Today, 09:53
Joined
Dec 21, 2006
Messages
600
Hi All,

I've set up a command button to export my query to an excel file but I'm not sure how I can ask for the date range before the file is exported?

I have this for code:

Code:
Private Sub Command5_Click()
DoCmd.OutputTo acOutputQuery, "QryMaster", acFormatXLS
End Sub


And I have this code for my 'EntryDate' field in my query:

Code:
Between [Enter the Start Date] And [Enter the End Date]

How do I merge the two together?

Thank you!
 
I use form controls for the user to enter the dates. The OutputTo would use them.
 
Do you mean having fields to enter in dates and then hit the command button?
 
Yes; I feel I have more control that way. I can validate the dates, etc.
 

Users who are viewing this thread

Back
Top Bottom