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!

If checkbox checked display message...

Status
Not open for further replies.

mvital

Technical User
Jul 2, 2003
128
US
Hi!

I've looked everywhere and I can't find what I need. I know it is simple I just don't know the syntax. I am fairly new with VBA, but getting better.

I have a form with a checkbox (not option group). If the checkboxed is checked I want a message to display to the user that they have to fill out a quantity.

I also don't want the user to leave the form with out filling out the quantity.

thanks in advance!

 
You could try:

Private Sub NameOfCheckbox_AfterUpdate()

If Me.Checkbox = True Then
MsgBox "You need to fill out the quantity"
Me.Quantity.SetFocus

Exit Sub
End If


End Sub
 
Thank You Hafa1961. Worked great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top