Ican't figure out why the Msgbox does not appear. What am I doing wrong?
If the Status field on the Worksheets form is set to 'Approved', I want the form to open, but I also want a Msgbox informing the user that they can't edit the form.
Here is my code:
If "Worksheets.Status" = "Approved" Then
DoCmd.OpenForm "Worksheets", acNormal, , strWhere, acFormReadOnly, acWindowNormal
Msgbox "Unable to edit 'Approved' Reports"
Else
DoCmd.OpenForm "Worksheets", acNormal, , strWhere, acFormEdit, acWindowNormal
If the Status field on the Worksheets form is set to 'Approved', I want the form to open, but I also want a Msgbox informing the user that they can't edit the form.
Here is my code:
If "Worksheets.Status" = "Approved" Then
DoCmd.OpenForm "Worksheets", acNormal, , strWhere, acFormReadOnly, acWindowNormal
Msgbox "Unable to edit 'Approved' Reports"
Else
DoCmd.OpenForm "Worksheets", acNormal, , strWhere, acFormEdit, acWindowNormal