D
dave h
Hi,
Here is a test scenario that represents the basics of my problem:
Create "table1" with an autonumber "keyfield" and a text "txtField" -
keyfield is the primary key
Create "frmTable1" with the form design wizard using table1 and all the
defaults options
Set the properties for the form to data entry=yes; allow additions=yes;
allow deletions=no; allow edits=no
In code, put this
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim response As Integer
response = MsgBox("Do you want to add a Person?", vbYesNoCancel)
If response = vbNo Then
Cancel = True
DoCmd.SetWarnings False
End If
End Sub
Test by :
putting at least one character in the txtField and then close the form by
clicking the X in the upper right hand corner of the form.
Respone "No" to the msgbox question.
Notice that, after you respone "no" you get a message: "you can't save this
record at this time" and then more instructions and some buttons.
How can I suppress this warning as SetWarnings did not do the trick?
Thanks, Dave H
Here is a test scenario that represents the basics of my problem:
Create "table1" with an autonumber "keyfield" and a text "txtField" -
keyfield is the primary key
Create "frmTable1" with the form design wizard using table1 and all the
defaults options
Set the properties for the form to data entry=yes; allow additions=yes;
allow deletions=no; allow edits=no
In code, put this
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim response As Integer
response = MsgBox("Do you want to add a Person?", vbYesNoCancel)
If response = vbNo Then
Cancel = True
DoCmd.SetWarnings False
End If
End Sub
Test by :
putting at least one character in the txtField and then close the form by
clicking the X in the upper right hand corner of the form.
Respone "No" to the msgbox question.
Notice that, after you respone "no" you get a message: "you can't save this
record at this time" and then more instructions and some buttons.
How can I suppress this warning as SetWarnings did not do the trick?
Thanks, Dave H