drop down problem.

buggy2

Board Regular
Joined
Feb 28, 2003
Messages
69
I have generated a form based on one table. it contains 3 combo boxes the first lets the user select the date of the info, the second selects the area and the 3rd contains all the a number of fields (selected field names for the same table) that relate to info. At the moment i am running a query using

[Forms]![myform].[Form]![mycombo]


but when I enter it in for the 3rd combo box it is returning the field name.


eg. combo1 = march 2003

combo2= london

combo3= units sold


When I run this it gives me entries |march 2003|London| and what was selected in combo3 in text (not the value).
In this case it will give:

date | Area | value

march 2003 London units sold
march 2003 London units sold
march 2003 London units sold
" " "

what i need is to query using the value:

date | Area | value

march 2003 London 24
march 2003 London 12
march 2003 London 25
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
combo box

the only solution i have at the moment is to use nested if statements and seperate docmd.runsql or runquery statement for all but this will build up to alot of queries.

if combo1.value="a" then
docmd.runsql "statement"
elseif combo1.value="b" then
docmd.runsql "statement"
.......................
end if

where a and b are fields in my table
 
Upvote 0

Forum statistics

Threads
1,221,517
Messages
6,160,264
Members
451,635
Latest member
nithchun

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