repeating parameter query

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

Guest

I have a parameter query where it prompts for an account number. Once the
account number is entered, a form displays the account information. When I
try to print the form however, I have the print button coded to open a report
for printing. But the query runs again and asks for the account number again.
Once the account is entered again then the report comes up. How can I either
prevent the second request button from appearing, or at least automatically
enter the same account number from the previous account request box?

Dino
 
1) don't use parameter prompt queries (reference controls on forms)
2) don't print forms, use reports for publishing to paper
 
Hmmm....I don't believe I know how to go about doing #1. You mean to have a
control inside of the form that asks for the account number?

As for #2, the form is used to display the account information. Not all
accounts will need to be printed, but if a user decided that they needed a
printout after viewing it, I thought the most convenient way was to have a
print button on the form, which opened a report that could be printed. I
don't see how else to get to view something before you decide to print. All
my other forms work great this way, but they don't have a parameter query
associated with them.
 
You can open a form or report using a where condition. For instance:

OpenForm "frmYourForm", acNormal, , "[AccountNum]=" & Me.cboAccountNum

This would allow you to remove the criteria parameter prompt from the form
or report's record source query.

If you are printing a report, change its record source to remove the
parameter and specify a where clause as noted above.
 
Thanks! It's working great now.


Duane Hookom said:
You can open a form or report using a where condition. For instance:

OpenForm "frmYourForm", acNormal, , "[AccountNum]=" & Me.cboAccountNum

This would allow you to remove the criteria parameter prompt from the form
or report's record source query.

If you are printing a report, change its record source to remove the
parameter and specify a where clause as noted above.


--
Duane Hookom
MS Access MVP


Dino said:
Hmmm....I don't believe I know how to go about doing #1. You mean to have
a
control inside of the form that asks for the account number?

As for #2, the form is used to display the account information. Not all
accounts will need to be printed, but if a user decided that they needed a
printout after viewing it, I thought the most convenient way was to have a
print button on the form, which opened a report that could be printed. I
don't see how else to get to view something before you decide to print.
All
my other forms work great this way, but they don't have a parameter query
associated with them.
 
Back
Top