Passing variables across macros

Peter Whitfield

Registered User.
Local time
Today, 16:03
Joined
Oct 25, 2001
Messages
13
Apologies, if this is old hat however Im currently teaching myself Access 97 after years of DataEase.

I have 2 macros that run a) a spreadsheet export based on a date selected and then b) a printed report on the same date.

However, I cant seem to find a way to ask for the date at the start of the first macro and pass it to the second, therefore I am having to ask the same question twice.

In DataEase it would have been set as a global variable and passed over.

Peter
 
Is the selected date part of a query? If so, you can create a form (frmAsk4Date), unbound, and put an unbound control (or 2 for parameters) on it.

Write your query as

tblSpreadsheetData
field: DateField
criteria: =Forms!frmAsk4Date![ControlName]

Put a command button on your unbound form to execute the query, run your export and run your report.

Your report can be based off the same query.
 
Cheers mate, your a genius!
 

Users who are viewing this thread

Back
Top Bottom