yes/ no message box

11am

New member
Local time
Today, 08:11
Joined
Apr 21, 2005
Messages
5
im new to access and havin trouble with this problem though i have used visual basic for a while i have the following code to close a form down. in vb the red code would be used to create the yes no msg box but when i compile it is fine then when i use the button it isnt accepted the red coding bit. any help with what im doing worng would be appreciated.


Private Sub Command28_Click()

On Error GoTo Err_Command28_Click

If (MessageBox.Show("Are you sure you want to exit?", "EXIT?", _
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = DialogResult.Yes) Then


DoCmd.Close

Exit_Command28_Click:
Exit Sub

Err_Command28_Click:
MsgBox Err.Description
Resume Exit_Command28_Click


End Sub
 
Code:
if msgbox("Are you sure you want to exit?", vbYesNo,"Exit") = vbYes then docmd.close

(I think I have this correct :o )
 
works fine thanks
 
THe code you originally had is VB.NET and not VBA.
 
You're doing VB.Net stuff now SJ?
 
Isn't MSO VBA for 2003 supposed to be on a .NET type architecture? That's what I thought...?

I'm still on 2002, so I don't know.
 
I've got videos for that as well - but I haven't had time to go through them...

Did the others help?
 
KenHigg said:
Did the others help?

The ones that I've watched thus far have helped. Think I've watched about 20 of them.
 

Users who are viewing this thread

Back
Top Bottom