On I form I have a combo box called cboMobileStatus.
Its row source type is "Value List"
The row source is: 1;" All";2;"Has";3;"None"
I have a query based on table "tblCustomerContacts" and I want to limit the records returned based on the value of the combo box.
So if the user selects:
* All (1) I want all records returned.
* Has (2) I only want records that have a mobile number returned
* None (3) I only want records that do not have a mobile number returned
The field mobile is text (to keep the leading 0)
I thought of using the Switch function in the criteria of the query for field Mobile like this:
but the query does not like it!
Am I on the right track, and if so, how should I modify the code?
If not, how should I be doing this?
Manny thanks
Its row source type is "Value List"
The row source is: 1;" All";2;"Has";3;"None"
I have a query based on table "tblCustomerContacts" and I want to limit the records returned based on the value of the combo box.
So if the user selects:
* All (1) I want all records returned.
* Has (2) I only want records that have a mobile number returned
* None (3) I only want records that do not have a mobile number returned
The field mobile is text (to keep the leading 0)
I thought of using the Switch function in the criteria of the query for field Mobile like this:
Code:
Switch([Forms]![frmPrintCustomer]![cboMobileStatus]=1,([tblCustomerContacts].[Mobile]) Like "*",[Forms]![frmPrintCustomer]![cboMobileStatus]=2,([tblCustomerContacts].[Mobile]) Is Not Null,[Forms]![frmPrintCustomer]![cboMobileStatus]=3,([tblCustomerContacts].[Mobile]) Is Null)
Am I on the right track, and if so, how should I modify the code?
If not, how should I be doing this?
Manny thanks