You might try the Select Case statement instead.
Select Case Right(B62, 1)
Case "a"
Dosomething
Case "b"
Dosomething
Case Else
Dosomethingelse
End Select.
Or maybe an If/Then/Elseif:
If Right(B62, 1) = "a" Then
DoSomething
ElseIf Right(B62, 1) = "b" Then
DoSomething
ElseIf Right (B62, 1) = "c" Then
DoSomething
Else
DoSomethingelse
End If
This is sometimes preferable to nested if statements.
hth
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
"BTU_needs_assistance_43" wrote:
> So I discovered that not all my reports will go in order and sometimes they
> will end with "a", "b", "c", or "d" instead of just "a". I had a working
> program set up to chop off "a" if it was at the end. But now that I have
> rewritten it to include more letters, the program still gives an output value
> but never chops anything at all off the letter and I'm trying it with both an
> If Then Else statement and an If Then Goto Else Goto statement. The program
> runs successfully but gives the same wrong output both ways. Is my logic
> faulty in this program? Can I not interlace functions like this? What is the
> deal!?
>
> IF/THEN/ELSE:
>
> If Right(B62, 1) = "a" Then
> rst![Total Shot Name] = Left([vShots], Len(vShots) - 1)
> Else
> If Right(B62, 1) = "b" Then
> rst![Total Shot Name] = Left([vShots], Len(vShots) - 1)
> Else
> If Right(B62, 1) = "c" Then
> rst![Total Shot Name] = Left([vShots], Len(vShots) - 1)
> Else
> If Right(B62, 1) = "d" Then
> rst![Total Shot Name] = Left([vShots], Len(vShots) - 1)
> Else
> rst![Total Shot Name] = vShots
> End If
> End If
> End If
> End If
>
>
>
> IF/THENGOTO/ELSEGOTO
>
> If Right(B62, 1) = "a" Then GoTo CutShort Else GoTo Checkforb
> Checkforb: If Right(B62, 1) = "b" Then GoTo CutShort Else GoTo Checkforc
> Checkforc: If Right(B62, 1) = "c" Then GoTo CutShort Else GoTo Checkford
> Checkford: If Right(B62, 1) = "d" Then GoTo CutShort Else GoTo SameName
> CutShort: rst![Total Shot Name] = Left([vShots], Len(vShots) - 1)
> SameName: rst![Total Shot Name] = vShots
> rst.Update