Combo Box Value

Smokeeater

Registered User.
Local time
Today, 12:47
Joined
Jan 15, 2009
Messages
58
I have a combo box on a report menu and want to use the value's for other activities. The combo is cmbReports, with (2) fields:

ID Name
1 Red
2 Blue
3 Yellow
4 Green

How would I reference a value of blue, in a "if" statement situation?

If Me.!cmbReports = "Blue" ................

Getting stuck on this one.

Thanks.
 
Why not just reference the ID value?

Reference combobox columns by index. Index begins with 0. So:
Me.cmbReports.Column(1) = "Blue"

Don't use both . and !.

Name is a reserved and should not use reserved words as names for anything.
 
June7 - thank you very much for your quick reply. That is what I needed.
 
Thanks Pat. I will keep that in mind when developing the code.
 

Users who are viewing this thread

Back
Top Bottom