CharlesHerrick
Registered User.
- Local time
- Today, 14:03
- Joined
- Oct 28, 2003
- Messages
- 20
I'm using the following If statement in an Access 2000 procedure:
If state = "KY" And county <> 'Knox' And county <> 'Scott' Then
do something
End If
I want to change this to let a user pick one of more county names from a list, use the selections to build and save a "condition" clause in a variable, then use the variable in the "If" statement, like this:
Dim strCounty As String
strCounty = " And county <> 'Knox' And county <> 'Scott' "
If state = "KY" & county Then
do something
End If
This scenario gives a False result, regardless of the data. I've tried wrapping the entire condition in parentheses, and using Variant instead of String for the variable, with no luck. Am I trying the impossible? If so, is there another method that would accomplish the same thing?
Thanks for any and all help.
If state = "KY" And county <> 'Knox' And county <> 'Scott' Then
do something
End If
I want to change this to let a user pick one of more county names from a list, use the selections to build and save a "condition" clause in a variable, then use the variable in the "If" statement, like this:
Dim strCounty As String
strCounty = " And county <> 'Knox' And county <> 'Scott' "
If state = "KY" & county Then
do something
End If
This scenario gives a False result, regardless of the data. I've tried wrapping the entire condition in parentheses, and using Variant instead of String for the variable, with no luck. Am I trying the impossible? If so, is there another method that would accomplish the same thing?
Thanks for any and all help.