Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Criteria in a query linked to a form

Status
Not open for further replies.

westoby1989

Technical User
Jul 7, 2010
7
GB
I have a button on a form that is used to open a query to display appropriate information based on the information entered in that form. The query uses the following criteria:

[Forms]![flight query]![flight id]

Where [flight query] is the name of the form. The idea is that the query displays data only relevant to the current entry.

The report used to display the correct information however I have since set up a switchboard. This opens the form in "Add mode" but when data is added and the button is pressed to open the query there are no records displayed.

Can anybody explain why there are no records being displayed and how to fix it?
 
Why are you entering the opening the form in add mode? Isn't this form used only to select/enter criteria to filter the report?

Or, is the form used to enter data into tables? If so, you must make sure the data is saved in the table prior to opening the report.

Duane
Hook'D on Access
MS Access MVP
 
Sorry, the name is a bit confusing. The form is used to enter details (it's a flight for a flying school) so things like the customer, instructor time of the flying lesson and aircraft. The button is then used to run a query which can in turn generate an invoice report for that specific flight that has been entered.

I do have a separate form that is used select criteria to generate invoices for previous flights and this works fine.
 
Any comments regarding my statement
Duane said:
... you must make sure the data is saved in the table prior to opening the report.
If the record hasn't been saved to the table(s) then there is nothing to print in the report. Do you have any code you can share?

Duane
Hook'D on Access
MS Access MVP
 
Right, I've got it now. I've changed the visual basic to save the record before running the appropriate macro.

Thanks very much for you help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top