I had a question about message boxes which June was able to guide me through. On my subform I have a text box that allows the user to enter data. If they do, the following message appears (code included):
[Private Sub Decline_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
Dim iResponse As Integer
strMsg = "A record has been entered into AdSeg Decline? Is this entry correct or should it be entered into your 20000 record? "
iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")
If iResponse = vbNo Then
Cancel = True
Else
Cancel = False
End If
End Sub]
This is not exactly what June gave me...I did some more searching and found this and tried it...Seems to work well but not where I need it to be...
Now that I've had a chance to mess around with this, how can I get it to delete the entry if data is entered in error? I've tried this code (purple) with no luck. Is what I want to do possible? This is a text box in a subform. I've searched through this and other forums with no luck. Any assistance is appreciated.
[Private Sub Decline_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
Dim iResponse As Integer
strMsg = "A record has been entered into AdSeg Decline? Is this entry correct or should it be entered into your 20000 record? "
iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")
If iResponse = vbNo Then
DoCmd.RunCommand acCmdUndo and also Me.Undo
Cancel = True
End If
End Sub]
Thank you for any help...