Form stays open in Print Preview

D

Denise D

My parameters were passing to my report in print preview, but when I pressed
the print buttom the #Name? error showed up on the printed report. So I
removed the close form from my macro and now the form floats over my print
preview screen. Is there something that I can do in my macro to git rid of
the form, but be able to read the parameters from it?
 
B

Barry Gilbert

In the macro, instead of closing the form, hide it. Use the SetValue action
and point it to the form's Visible property. Set this to False. Then in the
report's OnClose event, close the form.

Alternately, pass your parameters to the report using the Where Condition
property or ther OpenReport action. Then you should be able to close the form
immediately.

Barry
 
D

Denise D

I am not familiar with passing parameters using the Where Condition property.
How do you do this? (Sorry I'm a newbie. Thanks for your time and
patience.)
 
B

Barry Gilbert

The Where Condition just filters the data the report picks up. It's similar
to the conditions you put in the report's query. For example, you might have
a date column that has the following condition:
Between Forms!MyForm!txtFromDate and Forms!MyForm!txtToDate

If this applied to a field in your report called DateEntered, then the Where
Condition would be:
[DateEntered] Between Forms!MyForm!txtFromDate and Forms!MyForm!txtToDate

You can use any expression here including =, >, <, etc.

I hope this is clear.

Barry
 
D

Denise D

Thank you Barry!

Barry Gilbert said:
The Where Condition just filters the data the report picks up. It's similar
to the conditions you put in the report's query. For example, you might have
a date column that has the following condition:
Between Forms!MyForm!txtFromDate and Forms!MyForm!txtToDate

If this applied to a field in your report called DateEntered, then the Where
Condition would be:
[DateEntered] Between Forms!MyForm!txtFromDate and Forms!MyForm!txtToDate

You can use any expression here including =, >, <, etc.

I hope this is clear.

Barry

Denise D said:
I am not familiar with passing parameters using the Where Condition property.
How do you do this? (Sorry I'm a newbie. Thanks for your time and
patience.)
 
Top