I have a report running on two queries. Each query has a where clause with the same parameter:
What I've already done is to code when a user presses the confirm button, to write the most recent booking id to a variable. What I want is this variable to be passed straight to the parameter so the enter parameter message box doesn't come up and the report opens to the correct record.
What I was thinking to do is:
But the parameter box still opens. What's the best way to do this?
Code:
WHERE bookings.bookingid=[latestbooking]
What I've already done is to code when a user presses the confirm button, to write the most recent booking id to a variable. What I want is this variable to be passed straight to the parameter so the enter parameter message box doesn't come up and the report opens to the correct record.
What I was thinking to do is:
Code:
latestbooking = DMax("bookingid", "bookings")
DoCmd.OpenReport "Booking Confirmation", acViewPreview, , latestbooking
But the parameter box still opens. What's the best way to do this?