R
Ray C
I have an Unbound Text Box called "Find_SerialNo" for the user to enter the
Serial No of the equipment they want to find in the table. Because some
serial numbers are Numeric and Some Serial Numbers at Alpha numeric, I have
designated the Serial Number field in the Table to be a String.
If I enter "12abc345" in the "Find-SerialNo" text box the rest of the code I
have written finds the record. No problem. If I enter "1234" the code I have
written will not find the Record Serial No "1234" because I entered a Numeric
value. OK makes sense to me so the answer is to force the numeric input to be
a string
Private Sub Find_SerialNo_AfterUpdate()
Dim FieldInfo As String
FieldInfo = Find_SerialNo
FieldInfo = Str(Find_SerialNo)
'Find_SerialNo = Right(Find_SerialNo, Len(Find_SerialNo) - 1)
' Find_SerialNo = Format(Find_SerialNo)
If IsNumeric(FieldInfo) Then Debug.Print ; "Number"
If Not IsNumeric(FieldInfo) Then Debug.Print ; "String"
I have tried everything I can to convert the numeric input into a string
(as above) but the test "If IsNumeric(Field Info) always Prints "Number"
Anyone know what is going on?
Thanks and regards RayC
Serial No of the equipment they want to find in the table. Because some
serial numbers are Numeric and Some Serial Numbers at Alpha numeric, I have
designated the Serial Number field in the Table to be a String.
If I enter "12abc345" in the "Find-SerialNo" text box the rest of the code I
have written finds the record. No problem. If I enter "1234" the code I have
written will not find the Record Serial No "1234" because I entered a Numeric
value. OK makes sense to me so the answer is to force the numeric input to be
a string
Private Sub Find_SerialNo_AfterUpdate()
Dim FieldInfo As String
FieldInfo = Find_SerialNo
FieldInfo = Str(Find_SerialNo)
'Find_SerialNo = Right(Find_SerialNo, Len(Find_SerialNo) - 1)
' Find_SerialNo = Format(Find_SerialNo)
If IsNumeric(FieldInfo) Then Debug.Print ; "Number"
If Not IsNumeric(FieldInfo) Then Debug.Print ; "String"
I have tried everything I can to convert the numeric input into a string
(as above) but the test "If IsNumeric(Field Info) always Prints "Number"
Anyone know what is going on?
Thanks and regards RayC