Re: PopUp help

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



To expand on the other response, you would probably use something like this in the text box Before Update event:

If Me.SomeTextBox <> 8 Then
MsgBox "Status box must be checked"
Me.chkStatus.SetFocus
End If

Or to refine it a bit:

Dim strMsg as String
strMsg = "Was overtime worked? If so, " & _
"status box will be checked"
If Me.SomeTextBox <> 8 Then
If MsgBox(strMsg,vbYesNo) = vbYes Then
Me.chkStatus = True
Else
Me.Undo
Me.SomeTextBox.SetFocus
End If
End If

SomeTextBox is the text box in which the 8 (or whatever) is stored.

On the other hand, if Status is dependent entirely on the contents of the text box it may not be necessary at all. You may be using two fields to store the same information. As it is, if the number gets changed from 4 back to 8 then you would need more code to uncheck the Status box.

"Chad" <Chad@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:E947A11A-8FAB-4963-B36E-1332207E3F53@xxxxxxxxxxxxxxxx
Hello, I have a text box that has a set value of 8 in it. If someone changes
the number to 4 then I would like a pop up to come up stating "If overtime is
worked then status box must be checked". How would I do this?

Thanks!

.



Relevant Pages

  • Re: Warning message
    ... MsgBox "Check ERISA 180 Day Requirement" ... What do you mean "I put it into the first Sub"? ... That's when any code in the text box's After Update event will run. ... See Help for information on zero-length strings. ...
    (microsoft.public.access.forms)
  • Re: Validation Rule Problem
    ... Response As Integer) ... MsgBox "The new Diagnosis has been added to the list." ... , vbInformation, "FBW Physiotherapy" ... the data is added as lower case without the validation rule kicking in. ...
    (microsoft.public.access.forms)
  • Problems with input-validation
    ... i.e. leaving the field empty. ... Response As Integer) ... MsgBox \"Only numerical input allowed in \" & ctl.Name ... how can i do a working validation of user-input? ...
    (microsoft.public.access.formscoding)
  • Re: NotInList
    ... Response As Integer) ... Dim intAnswer As Integer ... MsgBox "The new city has been added to the list." ... tblCities, so want to add them as the need arises. ...
    (microsoft.public.access.formscoding)
  • Re: Limit Keys
    ... If you get paid to do as your told, or if you really don't know any better, ... terribly intuitive for a new user, whereas a combo or option group is. ... Dim response As Integer ... MsgBox "New record added", vbOKOnly ...
    (microsoft.public.access.formscoding)