Query not working using combo box

pcharnock1981

New Member
Joined
Jan 13, 2016
Messages
3
Hi

I have set up a database (not looked at access for years)

I have

-1 table with all info in (tbl_main)
-1 Table for manufacturer names (these control 1 combo) (tbl_manu)
-1 Table for Items (the 2nd combo) (tbl_item)

-1 form with 2x combo manufacturer & items and also 1 button to open report

-1 query - all info from main table (relationship with all tables) criteria on Manufacturer Column = forms!formname!combo1, Item column = forms!formname!combo2

-1 Report using query data

This seems correct and should be working but when i run the query with the form open it displays no results

Any help would be much appreciated

Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
when you post code and object names, you should use the actual names, otherwise we'd assume the problem is that forms!formname!combo1 should be forms!tbl_manu!combo1 because of what you wrote. So I'm just guessing that you have not referenced the form and/or control properly, or the combo returns more than one field and the bound column of the combo has the wrong data in it. To trouble shoot things like this, you can put valid values in your query to test it, or put temporary debug.print statements to check what your code or sql is returning; e.g. Debug.Print forms!YourformName.YourControlName
 
Upvote 0
Hi

I have set up a database (not looked at access for years)

I have

-1 table with all info in (tbl_main)
-1 Table for manufacturer names (these control 1 combo) (tbl_manu)
-1 Table for Items (the 2nd combo) (tbl_item)

-1 form (frm_report) with 2x combo manufacturer & items (1 for manufacturer = ManName, 1 for items = ItemName) and also 1 button to open report

-1 query - all info from main table (relationship with all tables) criteria on Manufacturer Column = [Forms]![frm_Report]![ManName], Item column = [Forms]![frm_Report]![ItemName]

-1 Report using query data

This seems correct and should be working but when i run the query with the form open it displays no results

Any help would be much appreciated

Thanks

Please see updated objects above

I have tried typing the values directly into the criteria rather than use the combo and it works, this is why I am a little confused with it. All spellings are correct

Thanks
Paul
 
Upvote 0
So what did this return
Debug.Print forms!YourformName.YourControlName
in order to confirm or dispel this
or the combo returns more than one field and the bound column of the combo has the wrong data in it
 
Upvote 0
Hi

After looking into it further I had actually bound the ID column not the second as the debug was returning 1 and not 2

Thanks for your help
 
Upvote 0
That's where I was coming from. Glad you solved it.
 
Upvote 0

Forum statistics

Threads
1,221,829
Messages
6,162,232
Members
451,756
Latest member
tommyw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top