If value in report combobox A, B or C, then another combo box d or e.

rowbro

Board Regular
Joined
Dec 16, 2010
Messages
50
Good day all,

I have a simple issue that I am struggling to resolve. In an access report I have a combobox (Called "InterestCode") that looks up a value from a query and outputs that value. There are a number of options , eg. M1, M2, M3, P1, P2 etc.

Depending on this value, I would like another combobox on the same report to show either "Dividend" or "Interest". E.g. if M1, M2 or M3, then "Dividend", if P1, P2, then "Interest".

I am sure there is a simple way to do this via the data tab in the property sheet, however I cannot figure it out.

Can someone kindly assist?
 
Last edited:

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
this might work:

Code:
=IIF(Left([InterestCode],1) = "M","Dividend", IIF(Left([InterestCode],1) = "P", "Interest"), "")

But I'm not sure what happens if nothing is selected (null? blank? Error?). And of course it is limited to things that start with M or P. A DLookup on interest codes would be more robust if you have that data in a table.
 
Upvote 0
Thanks, this is helpful. The only issue is that there are a distinct set of codes that could be "interest" or"dividend" and they don't all start with the same letter (sorry, poor example I gave).

I think it best if I either define them (about 20 in total) or set up a table as you suggest and do a Dlookup.
 
Upvote 0
Okay. You could put a long in () clause in the formula I guess. But dlookup would be cleaner.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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