I'm using vb4-16(since work has crappy puters), and I search a database for a serial number and if not found pops up a msgbox saying so. But even if the number is found the msgbox comes up anyway.
I Know the answer is so simple that i'm overlooking it, but since I work 12 hours a day, its kinda hard to even see when I get to working on this app. Any help would earn my undying gratitude
Here is the code...
'Search for a serial number
On Error Resume Next
Message = "Enter the Serial Number you want to find."
Title = "S/N Search"
Dim searchtext As Integer
searchvalue = InputBox(Message, Title)
If searchvalue = "" Then MsgBox "Please enter a Serial Number to find": Exit Sub 'MsgBox "Please enter a Serial Number to find"
searchtext = Val(searchvalue)
Data1.Recordset.FindFirst "SerialNumber = " & searchvalue
If Not searchvalue Then MsgBox "No Record Found!"
End Sub
I Know the answer is so simple that i'm overlooking it, but since I work 12 hours a day, its kinda hard to even see when I get to working on this app. Any help would earn my undying gratitude
Here is the code...
'Search for a serial number
On Error Resume Next
Message = "Enter the Serial Number you want to find."
Title = "S/N Search"
Dim searchtext As Integer
searchvalue = InputBox(Message, Title)
If searchvalue = "" Then MsgBox "Please enter a Serial Number to find": Exit Sub 'MsgBox "Please enter a Serial Number to find"
searchtext = Val(searchvalue)
Data1.Recordset.FindFirst "SerialNumber = " & searchvalue
If Not searchvalue Then MsgBox "No Record Found!"
End Sub