Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message box

Status
Not open for further replies.

shelspa

Technical User
Dec 13, 2001
66
US
When my users enter a number that is out of spec, I want a message to appear saying "Out Of Spec". This will prevent them from moving on until they click OK. They need to notice that they are out of spec. The validation rule feature doesn't allow them to move on unless the data meets a criteria. They need to be able to move on with the data the way it is. Ideas appreciated.
 
In the BeforeUpdate event procedure of the control you display a Yes/No or OK/Cancel message box if the number is out of spec and you set the Cancel argument to True if the user don't click the OK or Yes button.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You can also use Me.ControlName.UnDo in the BeforeUpdate event to return the ControlValue to what it was before they changed it.

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
So in an event procedure I have:

If Me!Site_1_Index > 1.965 and < 2.015 Then

What?
 
VBA needs this syntax:
If Me!Site_1_Index > 1.965 and Me!Site_1_Index < 2.015 Then
'...If that is good then do nothing
Else
MsgBox "Must be between 1.965 and 2.015"
Cancel = True
End If

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
I think that is close but I get a variable not defined for the word cancel.
 
Where did you put the code? It should be in the BeforeUpdate event of the Site_1_Index control.

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
I had it in after update. However, when I put it in before update it will not let the user move on to the next field and leave the out of spec data in that field. It acts just like using a validation rule and validation text.
 
Got it. Cancel should = False Thanks.
 
Cancel is False unless you set it otherwise. Did you want to leave the invalid entry in the control?

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top