Easy Form passing value to query question

ppoindexter

Registered User.
Local time
Today, 10:41
Joined
Dec 28, 2000
Messages
134
i have a form that passes values to a query via 3 combo boxes

code as follows (for each combo box)
[Forms]![popfrm_Red]![Combo_1]

what do i add to this code so that if any of the 3 combo boxes IS NOT needed (no value passed to query) the query will just ignore any of the combo boxes that are not utilized

for instance if user selects data from
combo_1, combo_2 and
does not select any value from combo_3
i want the query to run using just the values passed from combo_1 and combo_2
thanks in advance
 
iif (isNull([Forms]![popfrm_Red]![Combo_1],"*",[Forms]![popfrm_Red]![Combo_1]))

???
ken
 
hi ken
i tried the code and got this error message

the expression has a function containing the wrong number of arguments

thanks for your help
 
Sorry,

iif (isNull([Forms]![popfrm_Red]![Combo_1]),"*",[Forms]![popfrm_Red]![Combo_1])


kh
 
now the error is
the expression is too complex....i placed in the query grid (criteria row) is this the problem?
 
thanks for your help ken.

got it working
here is my solution

1. placed the following code in a field row of an empty query grid
(one exp as below for each value (via combo box) i pass from the popform)

Combo_1: IIf(IsNull([Forms]![popfrm_Red]![Combo_1]),[fld1id]=[fld1id] Or ([tbl1].[fld1id])=IsNull([fld1id]),[fld1id]=[Forms]![popfrm_Red]![Combo_1])

2. placed the following in the criteria row of same grid
<>false
 

Users who are viewing this thread

Back
Top Bottom