Results 1 to 3 of 3

Thread: Question about InputBox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217
    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

  2. #2
    Guest
    newTruck = InputBox("Which truck number would you like search for?")
    If newTruck = "" Then Exit Sub
    'rest of the code...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217

    Talking

    Thanks Matthew

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width