MartinThe11th
New member
- Local time
- Yesterday, 18:19
- Joined
- Nov 13, 2009
- Messages
- 9
I have a global Variant variable which contains a number
i want to compare it with a String that contains another number
within an if statement .. :
the code for testing purposes ---->
myuser is the global variant
testuser is the String Variable .
the output of the if statement is always false .. even with the right numbers
and the msgbox output is correct .
is it possible to compare Variant with a string ?
if not what is the best way to get over this , without going and changing
the table field datatypes !?
help is appreciated .
Martin .
i want to compare it with a String that contains another number
within an if statement .. :
the code for testing purposes ---->
myuser is the global variant
testuser is the String Variable .
Code:
If myuser = testuser Then
Beep
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox myuser
MsgBox "test"
MsgBox testuser
End If
the output of the if statement is always false .. even with the right numbers
and the msgbox output is correct .
is it possible to compare Variant with a string ?
if not what is the best way to get over this , without going and changing
the table field datatypes !?
help is appreciated .
Martin .