The button on my InputPayer form works succesfully with the following procedure, but I seem to have to double-click either button before the form will close and the conditions (when satisfied) cause the code to execute:
Dim intnewrec As Integer
intnewrec = Form.NewRecord
If intnewrec = True And MsgBox("Do you wish to Input this Payer?", vbYesNo, "Required Field Warning!") = vbNo Then
Cancel = True
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
ElseIf intnewrec = False And MsgBox("Do you wish to Input this Payer?", vbYesNo, "Required Field Warning!") = vbNo Then
Cancel = True
Else
DoCmd.RunCommand acCmdSaveRecord
Forms!ReceiptsInput![Payee ID] = Me!Text36
Forms!ReceiptsInput.Refresh
End If
DoCmd.Close
No doubt there's is a fatal flaw, but being a total novice I can't see it. In fact it was a miracle I got this far! So if anyone can assist I should be, as ever, most grateful.
Ted
Dim intnewrec As Integer
intnewrec = Form.NewRecord
If intnewrec = True And MsgBox("Do you wish to Input this Payer?", vbYesNo, "Required Field Warning!") = vbNo Then
Cancel = True
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
ElseIf intnewrec = False And MsgBox("Do you wish to Input this Payer?", vbYesNo, "Required Field Warning!") = vbNo Then
Cancel = True
Else
DoCmd.RunCommand acCmdSaveRecord
Forms!ReceiptsInput![Payee ID] = Me!Text36
Forms!ReceiptsInput.Refresh
End If
DoCmd.Close
No doubt there's is a fatal flaw, but being a total novice I can't see it. In fact it was a miracle I got this far! So if anyone can assist I should be, as ever, most grateful.
Ted