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
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