Parameter: Query and Report

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

Guest

Hi. I am trying to create a report like many others that I have successfully
made in the past but can't figure out what I'm doing wrong here.

I have a query that asks for a user-selected input parameter:
WHERE (((tblAuctions.AuctionName)=[Forms]![AuctionParam]![FindAuction]))

My report calls for the same thing:
Private Sub Report_Close()
DoCmd.Close acForm, "AuctionParam"
End Sub

Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "AuctionParam", , , , , acDialog
If Not IsLoaded("AuctionParam") Then
Cancel = True
End If
End Sub

The query returns the correct information. However, the report can't seem
to figure out what Auction was selected and returns nothing. I have
AuctionName in the Page Header and it is blank.

Do I have a mismatch somewhere? Thanks for the help!
 
Open the Form first, and then from the form create a button to print the
report using the selection in the FindAction

When you open a form as dialog, the code halt until you close the form.
You open the form after the report, and the data in the report doesn't
refresh itself after the selection, and this is why you can't see the data on
the report.

My advice, as mantiond on top, open the form first and then print the report.
 
Back
Top