Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Posts
    31

    Unanswered: Creating a prompt

    Hi

    On my form i have text box where the user enters a given quantity.

    The text box is called 'remake number'. I would like to set the text box up so when a number is entered that is greater than 10,000 a message box appears and says: 'quantity greater than 10000 - is this correct'?.

    The message box should have a yes and no button. If no is selected the operator can re enter the number.

    Any suggestion on how this is best achieved?

    Thanks in advance

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You could use:
    Code:
    Private Sub remake_number_AfterUpdate()
    
        If Val(Nz(Me.remake_number.Value)) > 10000 Then
            If MsgBox("'quantity greater than 10000 - is this correct?", vbQuestion + vbYesNo, "remake_number") = vbNo Then
                Me.remake_number.Value = Null
                Me.remake_number.SetFocus
            End If
        End If
    
    End Sub
    Have a nice day!

  3. #3
    Join Date
    Apr 2012
    Posts
    31
    Thanks this works great! Thanks again!

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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