Hi,
I am “teaching” myself VB (version 6). I am trying to pass a value to a variable based on an If Then ElseIf statement. The problem is that only the 1st part of the statement works. That is, if the value fits the first part of the statement, then the program works fine, but if the value does not fit the first part (therefore should fit the ElseIf section) then the program hangs. Am I doing something wrong?? Below is the piece of code that I’m dealing with.
If txtPolicy <> "" Then
StrPolicySelectFormula = "{KB_CLAIM_POLICY_AMT_VIEW.POLNO}= '" & txtPolicy & "'"
ElseIf txtPolicy = "" Then
StrPolicySelectFormula = "{KB_CLAIM_POLICY_AMT_VIEW.POLNO}= {KB_CLAIM_POLICY_AMT_VIEW.POLNO}"
Exit Sub
End If
I've switched the sections around, and still the program will only work if the value fits the 1st part of the statement.
I am “teaching” myself VB (version 6). I am trying to pass a value to a variable based on an If Then ElseIf statement. The problem is that only the 1st part of the statement works. That is, if the value fits the first part of the statement, then the program works fine, but if the value does not fit the first part (therefore should fit the ElseIf section) then the program hangs. Am I doing something wrong?? Below is the piece of code that I’m dealing with.
If txtPolicy <> "" Then
StrPolicySelectFormula = "{KB_CLAIM_POLICY_AMT_VIEW.POLNO}= '" & txtPolicy & "'"
ElseIf txtPolicy = "" Then
StrPolicySelectFormula = "{KB_CLAIM_POLICY_AMT_VIEW.POLNO}= {KB_CLAIM_POLICY_AMT_VIEW.POLNO}"
Exit Sub
End If
I've switched the sections around, and still the program will only work if the value fits the 1st part of the statement.