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

rowbro

New Member
Joined
Dec 16, 2010
Messages
34
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:

Some videos you may like

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

xenou

MrExcel MVP, Moderator
Joined
Mar 2, 2007
Messages
16,628
Office Version
2013
Platform
Windows
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.
 

rowbro

New Member
Joined
Dec 16, 2010
Messages
34
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.
 

xenou

MrExcel MVP, Moderator
Joined
Mar 2, 2007
Messages
16,628
Office Version
2013
Platform
Windows
Okay. You could put a long in () clause in the formula I guess. But dlookup would be cleaner.
 

Watch MrExcel Video

Forum statistics

Threads
1,095,841
Messages
5,446,825
Members
405,417
Latest member
egrospe17

This Week's Hot Topics

Top