Yes/No message box!

edster

Registered User.
Local time
Today, 14:16
Joined
Sep 25, 2004
Messages
31
Hi all,
this site it a bit of a god send.hope you can help me, i've had a go at trying to code this myself but can't quite get it to happen.

i need a piece of code which will cause a message box to pop up if the value of a check box on a form is "True". I want it so that if the value is false nothing happens and the form continues an normal.
On the message box i need two options - yes/no - if yes is pressed the message box closes and goes back to the form, if no them both the message box and form close.

hope ive made it clear, all help welcome
many thanks in advance.

ed
 
Last edited:
Here's the basics of what you need. Let me know if you need help with the rest:

Code:
Dim msg, button, title, response
msg = "Message box text here"
button = vbYesNo + vbDefaultButton2
title = "Message box title here"

response = MsgBox(msg, button, title)
If response = vbYes Then
   'what to do if yes
Else  
   'what to do if not
End If
 
Code:
If CheckBox.Value = True then
     If msgbox("The Check Box IS checked",vbYesNo) = 6 then
          DoCmd.Close acForm, "MyForm", acSaveYes
     End if
End If
 
Sorted!!
Thanks a lot Paul, it worked brilliantly 1st time. Thanks to Jerry as well(didn't get round to yours but i'm sure it would)

Thanks again (got a feeling i'll be back again!!!)

Ed
 

Users who are viewing this thread

Back
Top Bottom