Dropdownlist based on query

  • Thread starter Thread starter Seaman
  • Start date Start date
S

Seaman

Hi,

I have a query which outputs 6 columns.
I have 2 dropdownlists which values are in the criteria
list of column 1 and 2 of the query
column 1 criteria [Forms]![Startform]![Combo21]
column 2 criteria [Forms]![Startform]![Combo79]

Default values of both dropdownlists are "@ALL".

The both dropdwonlists aren't supposed to be used
together, so when selected a value in 1 of the
dropdwonlists the other one is greyed out (disabled) an a
value """ is set in the greyed out dropdownlist.

So Is it possible to have 1 query for this ? Like when
selecting something from combo21, combo79 is disabled, and
everything from column 2 should be visible according to
the value selecting in combo 21. Also Vice Versa.

Now it shows nothing . Hope I made my point clear. Thanks
in advance
 
Hi,


Use a VBA function, in a standard module, not in the form, that picks
up the right value:


Public Function RightValue() As Variant

If ... Then
RightValue =[Forms]![Startform]![Combo21]
Else
RightValue =[Forms]![Startform]![Combo79]
End If

End Function


and use that function as "parameter"


.... WHERE myfield = RightValue( )




Hoping it may help,
Vanderghast, Access MVP
 
Back
Top