K
Kathryn
Hi,
I have the following code that resutls in a compile
error. It's purpose is to run some append queries to
create new records so the user can enter additional data.
The user chooses a grant and their name from drop-downs
before adding the info so it can be correlated to them.
Only one response per user is allowed. I wanted to set an
error message box so that if the user had already
evaluated a particular grant, they would get a message.
Do I need to attach the error event to another obejct?
Can you review my code and tell me if I am on track? I
have not used any On Error code before...
Private Sub cmdReviewGrant_Click()
On Error GoTo Err_cmdReviewGrant_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
DoCmd.SetWarnings False
DoCmd.OpenQuery "qappGrant"
DoCmd.OpenQuery "qappOrgAdd"
Me![sfrmGrants].Requery
Me![sfrmOrgAdd].Requery
DoCmd.SetWarnings True
Exit_cmdReviewGrant_Click:
Exit Sub
Err_cmdReviewGrant:
MsgBox Error$
Resume Exit_cmdReviewGrant_Click
End Sub
Thank you!
I have the following code that resutls in a compile
error. It's purpose is to run some append queries to
create new records so the user can enter additional data.
The user chooses a grant and their name from drop-downs
before adding the info so it can be correlated to them.
Only one response per user is allowed. I wanted to set an
error message box so that if the user had already
evaluated a particular grant, they would get a message.
Do I need to attach the error event to another obejct?
Can you review my code and tell me if I am on track? I
have not used any On Error code before...
Private Sub cmdReviewGrant_Click()
On Error GoTo Err_cmdReviewGrant_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
DoCmd.SetWarnings False
DoCmd.OpenQuery "qappGrant"
DoCmd.OpenQuery "qappOrgAdd"
Me![sfrmGrants].Requery
Me![sfrmOrgAdd].Requery
DoCmd.SetWarnings True
Exit_cmdReviewGrant_Click:
Exit Sub
Err_cmdReviewGrant:
MsgBox Error$
Resume Exit_cmdReviewGrant_Click
End Sub
Thank you!