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

rowbro

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

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

xenou

MrExcel MVP, Moderator
Joined
Mar 2, 2007
Messages
16,649
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
37
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,649
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,099,555
Messages
5,469,407
Members
406,649
Latest member
costarose

This Week's Hot Topics

Top