Form stays open in Print Preview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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.)
 
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
 
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.)
 

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

Back
Top