Hi all,
I've got a db that has been given me to develop queries for to fulfill requests for Management Information.
I have set some queries up and have them set to export into an excel sheet, so far so good. However 10 of these queries need to be run daily and then exported. If i go into them individually and change the date criteria, the correct data is then exported into excel.
To make this process easier for the end user i have amended the date criteria field in the query to read [forms]![formname]![startdate] this takes the date from an unbound text box on the form.
I have added a command button to the form with the following code behind to run the queries
Code:
Start Code
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryFirstQuery"
DoCmd.OpenQuery "qrySecondQuery"
DoCmd.OpenQuery "qryThirdQuery"
DoCmd.OpenQuery "qryFourthQuery"
DoCmd.OpenQuery "qryFifthQuery"
DoCmd.OpenQuery "qrySixthQuery"
DoCmd.OpenQuery "qrySeventhQuery"
DoCmd.OpenQuery "qryEighthQuery"
DoCmd.OpenQuery "qryNinthQuery"
DoCmd.SetWarnings True
''End Code
This works and everything is fine, however if i then open the excel spreadsheet the exported queries all report a nil total as if they are not taking the date through.
Has anyone any ideas how i can do this?