Open date form before printing current record

C

carriey

I don't use a lot of Macros but what I have built is a little macro so that
when the user is on the main form for the current employee and they hit
print, it will automatically print the summary report of that employee. It
works great!

Run Command = SaveRecord
OpenReport View = Print and then the where condition is
[Tbl_Employees]![Employee_ID]=[Forms]![Frm_Main]![Employee_ID]

The problem is that the user needs to be able to select the dates of
employee pay data to print. I built an unbound form for the user to enter a
Start and End Date and then in my query I entered the Date Parameters:

Between [Forms]![Frm_Dates]![Start_Date] And [Forms]![Frm_Dates]![End_Date]

I have tried adding into my macro to OpenForm before OpenReport but it still
prints the report right away so I think that I am missing a step in my macro.
Can someone help me? Please and Thank you!
 
S

Steve Schapel

Carriey,

2 options here...

1. Put the Start_Date and End_Date controls onto the Frm_Main form
instead, maybe in the form header section. That way you don't need to
open a separate from for the date criteria.

2. Run 2 separate macros. One to open the Frm_Dates form, and then the
OpenReport action goes in a separate macro which is run from another
command button or other event on Frm_Main form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top