I have an append query to a temp table which filter postal codes based on Clients being Active or Inactive. I am recording this true/false value to a text box on a form then passing the value to the parameter in the query. The choice of value is determined by a three-value option group 1 = false, 2, = true, 3 = either true or false.
I use a function to return the value needed to the parameter. If I select options 1 or 2 the parameter is passed properly. If I select option 3, I’m only getting one value.
Clearly the function is not passing information that the parameter can understand.
If, in my function, Case 1 = false and case 2 = true how do I pass the value case 3 = True Or False
I suspect one problem is that my function and the returned value is boolean but I need three possibilities, not two. Here’s the function. I’m writing in a hurry, so I can post back if there is still insufficient information. (PS I know strFilter is a goofy name for a Boolean. I adapted it from another use where it was a string. The use of null for case three was a failed attempt to get around this.)
Private Function FilterName(intVal As Integer) As Boolean
intVal = Me.OptAct.Value
Dim strFilter As Boolean
Select Case intVal
Case 1
Let strFilter = False
Case 2
Let strFilter = True
Case 3
Let strFilter = Null
End Select
FilterName = strFilter
End Function