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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a MSG BOX POPUP FOR A NUMBER FIELD

Status
Not open for further replies.

nunu

Technical User
Nov 10, 2002
7
US
Question - Is there any way I can make a msg box appear when the value of a field is greater than 2?

I can't seem to get the macro setvalue to work right for me.

Mary, thanks

 
Assuming the field is named "EnteredNumber", the following code will display the message "The Current Value is Greater than Two!" when the value is greater than 2 and the user moves out of the field:

Private Sub EnteredNumber_LostFocus()
If [EnteredNumber].Value > 2 Then
Dim Msg As String
Msg = "The Current Value is Greater than Two!"
MsgBox Msg, vbOKOnly + vbInformation
End If
End Sub

Hope this helps.

Missinglinq "It's got to be the going,
not the getting there that's good!"
-Harry Chapin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top