I am trying to select records that fall within a range.
The Range is specified on a Form as two strings (i.e. ParmFromTeamIdInt = 000 and F45300ParmToTeamId = 001) and converted to a Long Integer before comparison.
TEAM_ID is specified in the Table as Long with a Format of "000".
Using the following code if TEAM_ID is 0 or 1 I expect the 'In Range' message to display which it does. However if TEAM_ID is 2 it also displays 'In Range'.
A can't figure out why this is happening. What have I done wrong?
Dim ParmFromTeamIdInt As Long
ParmFromTeamIdInt = CLng(F45300ParmFromTeamId)
Dim ParmToTeamIdInt As Long
ParmToTeamIdInt = CLng(F45300ParmToTeamId)
If RS45EventTeamMstrLkup003!TEAM_ID >= ParmFromTeamIdInt & "And " & _
RS45EventTeamMstrLkup003!TEAM_ID <= ParmToTeamIdInt Then
MsgBox "In Range"
MsgBox "Out Of Range"