Macro to print report problem

belsha

Registered User.
Local time
Today, 08:14
Joined
Jul 5, 2002
Messages
115
I have a macro that runs behind a button on a form. When you click the button, the first thing that happens is a table containing only begin and end date is opened, what is entered in two textboxes on the form is entered, and the table is closed. Then a bunch of queries run that are based on the begin and end dates. Then a report that uses that same date criteria prints out. Problem is the report is printing the info for the previous set of dates entered in the textboxes, even though if you look in the tblDates it contains the most recent dates entered. Once you have printed that report, however, if you open it to check the dates it will now display and print the updated dates. I have tried opening and closing the report once before printing in the macro but that didn't work. Any ideas would be appreciated.
 
why have a table with 2 dates in it? You can reference the form date fields directly from the query.

Code:
Forms!FormName!FieldName

or

you could use input boxes from the query datefield criteria

[Enter Start Date]

[Enter End Date]

Also, I don't understand this bit

the first thing that happens is a table containing only begin and end date is opened, what is entered in two textboxes on the form is entered, and the table is closed.

- why is the table opened when you're using a form?

Col
 

Users who are viewing this thread

Back
Top Bottom