-
what could i add to this so if the user presses the cancel button, the program exits the sub. B/c in my program, if the user pressed cancel, it jumps down to the message where it says the truck doesn't exist, i dont want that. thanks
Private Sub cmdFind_Click()
Dim newTruck As String
' Get truck number from user, via InputBox
cmdFirst_Click
newTruck = InputBox("Which truck number would you like search for?")
adTruck.Recordset.Find "NewTruckNumber = '" & newTruck & "'"
If adTruck.Recordset.EOF Then
MsgBox ("Truck number does not exist does not exist!")
cmdFirst_Click
End If
End Sub
-
newTruck = InputBox("Which truck number would you like search for?")
If newTruck = "" Then Exit Sub
'rest of the code...
-