Passing Paramaters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using a union query to have a select all option in the combo box. The combo box has an after_update event procedure that assigns the result to a text box. The VBA code is

If isnull(me.cboCustomer) Then
me.txtCustomer = "Like " & chr(34) & "*" & chr(34)
Else me.txtCustomer = me.cboCustomer

If the All option is slected which is "Null" then I get an Expression is too complex in the Form record source I am passing it to. If I select an option with a value it works fine. Also, if i go to the form record source and enter Like "*" in the CustomerID criteron box then it works fine. Why wont it work if passing it? Is there something else I should be doing? Is there a better way to get all the values if selecting from a combo box?

Thanks for any suggestions.
 
brian said:
I am using a union query to have a select all option in the combo
box. The combo box has an after_update event procedure that assigns
the result to a text box. The VBA code is

If isnull(me.cboCustomer) Then
me.txtCustomer = "Like " & chr(34) & "*" & chr(34)
Else me.txtCustomer = me.cboCustomer

If the All option is slected which is "Null" then I get an Expression
is too complex in the Form record source I am passing it to. If I
select an option with a value it works fine. Also, if i go to the
form record source and enter Like "*" in the CustomerID criteron box
then it works fine. Why wont it work if passing it? Is there
something else I should be doing? Is there a better way to get all
the values if selecting from a combo box?

Thanks for any suggestions.

I think we need to see the code where you build the recordsource from
the value of the text box. You might also set a breakpoint and examine
the value of the recordsource string you've built. Post that too, if
the flaw isn't obvious.
 
Back
Top