PlasticGuy
New member
- Local time
- Today, 11:46
- Joined
- Aug 9, 2013
- Messages
- 2
Hello,
I have tried searching this and other forums, but I cannot seem to get the code correct.
I have a continuous form based on a query of multiple tables. There are two text fields on the form that are based on text data from fields in one of the tables on the query.
I have a series of option buttons that when clicked will filter the form based on a certain value (stored as a string value in the code) that may be in one of those fields for the record. (Example below uses two of the source fields)
I have no problem with this and I can get the form to filter the records just fine when a single option button is checked.
Example: both of these filter functions work fine
Me.Filter = "[Document Type] = '" & strform & "'"
Me.FilterOn = True
Me.Filter = "[Department] = '" & strtraffic & "'"
Me.FilterOn = True
The problem I have is when trying to filter when there is more than one option button checked at a time. I have no issue with the conditional logic on having one or more boxes checked, it is the actual multi filter code that does not work.
I have tried
Me.Filter = "[Document Type] = '" & strform & "'" And "[Department] = '" & strtraffic & "'"
I get runtime error 13 Type mismatch error
I have tried other variations that do not work at all.
Any help would be appreciated.
Thanks,
I have tried searching this and other forums, but I cannot seem to get the code correct.
I have a continuous form based on a query of multiple tables. There are two text fields on the form that are based on text data from fields in one of the tables on the query.
I have a series of option buttons that when clicked will filter the form based on a certain value (stored as a string value in the code) that may be in one of those fields for the record. (Example below uses two of the source fields)
I have no problem with this and I can get the form to filter the records just fine when a single option button is checked.
Example: both of these filter functions work fine
Me.Filter = "[Document Type] = '" & strform & "'"
Me.FilterOn = True
Me.Filter = "[Department] = '" & strtraffic & "'"
Me.FilterOn = True
The problem I have is when trying to filter when there is more than one option button checked at a time. I have no issue with the conditional logic on having one or more boxes checked, it is the actual multi filter code that does not work.
I have tried
Me.Filter = "[Document Type] = '" & strform & "'" And "[Department] = '" & strtraffic & "'"
I get runtime error 13 Type mismatch error
I have tried other variations that do not work at all.
Any help would be appreciated.
Thanks,