Conditional Rowsource for combobox (1 Viewer)

kmb

Registered User.
Local time
Yesterday, 19:12
Joined
Oct 1, 2009
Messages
26
Hi everybody.
Thanks for previous help. I have a new issue that may have an easy fix or it may not...I haven't found it here or on the net. Anyways, the basic idea is that I have 3 cascading combos on a form (Category Type, Category, and Subcategory). When I pick a Type, the correct categories are displayed in CategoryCombo and when a category is picked, the correct subcategories are displayed in SubCatCombo. In this sense the process is great.

However, I want to be able to not pick a Type (i.e. I or a user doesn't remember a particular category's type) and still be able to choose one of the categories.
Currently, if I don't choose a type I can't see any of the categories, but I want to make it so that if I do not pick a Type then I can still pick categories.

To be concise: Is there a way to make a combobox's rowsource query's Criteria conditional (IF statement) or is there another way to do this with VBA?

Something along the lines: (pseudocode)
If IsNull(CatTypeCombo) Then "make rowsource of CategoryCombo not depend on CatTypeCombo"
Else
"Work as it currently does"
End IF



Thanks in advance for any ideas or suggestions.
KmB
 

kmb

Registered User.
Local time
Yesterday, 19:12
Joined
Oct 1, 2009
Messages
26
This article isn't specific enough. Thanks very much though.
KMB
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 16:12
Joined
Aug 30, 2003
Messages
36,133
What method did you use to do the cascading combos? It should be a fairly simple adjustment to either of the normal methods.
 

kmb

Registered User.
Local time
Yesterday, 19:12
Joined
Oct 1, 2009
Messages
26
Pbaldy,
I used requerys in the after update event for the combos and I used one in the on current for the form. I made the criteria for Type in the query for the Category combobox as: the Combobox for the Type.

KMB
 

kmb

Registered User.
Local time
Yesterday, 19:12
Joined
Oct 1, 2009
Messages
26
Thanks very much. John sorry I hadn't looked at that link, I am going to save that for future reference. Pbaldy thanks for the info, that worked nicely, I didn't even think to try that. Again thanks very much.
KMB:)
 

Users who are viewing this thread

Top Bottom