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!

Use combo on form's tab page as query criteria

Status
Not open for further replies.

TrekBiker

Technical User
Nov 26, 2010
330
GB

I'd like to put a combo onto a page of a tab control on frmMenu, select a combo item and run a report for it.

I'm using forms!frmMenu.cboType as the criterion for the report's query source qryAddressesByType, but it comes back with error 'can't find the object qryAddressesByType'.

There's a different error message if trying to run the query directly, where it says 'Enter Parameter Value, asking for Forms!frmManu.cboType.

Searching for an explanation a Microsoft source says all objects on a tab page are like any elsewhere and to reference them the same way. What am I missing?
 
Do you set your "report's query source" in code? If so, could you share your code here?


---- Andy

There is a great need for a sarcasm font.
 
Is the combo box on a subform or just the tab on the main form?

What is the SQL view of the report's record source?

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
I'm starting with a blank frmMenu that I wanted to be a replacement for the normal Switchboard.

With this simple form it's easy to add several command buttons to call up things normally reached by the Switchboard. I was looking to go a stage further and have a set of tab pages for different groupings of items called up, so things related to Orders, Customers, Addresses, Products etc.

On the Addresses page I tried to add a combo to save space for one of the sub-groupings but got the error below when trying to call up qryAddressesByType, whether using the combo's AfterUpdate or directly via a command button

Capture_vjc1dt.jpg


The query opens correctly using the Nav Pane.
 
Did you try to run the query directly with the frmMenu open and something selected in the combo box?

How about providing the record source of the report?

What is your code to open the report?

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Yes, tried this and it opened correctly. Now I'm starting to feel embarrassed because after reworking the combo and its AfterUpdate it's now working correctly, both for the query and then changing to call up the report based on it.

Huge apologies for wasting your time.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top