G
Guest
I am using Access 2002.
I have a main form with 2 sub forms. I would like the user to not be able
to make changes to the main form or the subforms unless they are the
"Author". I thought I figured it out, but......... the UNDO action is
taken, message box is shown correctly, user clicks ok, and then the user can
edit/change and navigate to any field. It works well on the FORMS's before
update, but I want the user to see the msgbox as soon as they type (if they
are not authorized). Here is my code in the ON DIRTY event, any idea?
'If the user is not the Analyst and not an Author msgbox will display
If Me.cbo_Analyst <> Forms![Temp].Modify_By Then
If Forms![Temp].[strAccess] <> "Author" Then
Undo
MsgBox "You do not have Access to modify this Project"
Exit Sub
Else
Me.Modify_Date = Date
Me.Modify_By = Forms![Temp].[Modify_By]
Forms![Temp].[SR] = Me.SR
End If
End If
'********************************************************
I have a main form with 2 sub forms. I would like the user to not be able
to make changes to the main form or the subforms unless they are the
"Author". I thought I figured it out, but......... the UNDO action is
taken, message box is shown correctly, user clicks ok, and then the user can
edit/change and navigate to any field. It works well on the FORMS's before
update, but I want the user to see the msgbox as soon as they type (if they
are not authorized). Here is my code in the ON DIRTY event, any idea?
'If the user is not the Analyst and not an Author msgbox will display
If Me.cbo_Analyst <> Forms![Temp].Modify_By Then
If Forms![Temp].[strAccess] <> "Author" Then
Undo
MsgBox "You do not have Access to modify this Project"
Exit Sub
Else
Me.Modify_Date = Date
Me.Modify_By = Forms![Temp].[Modify_By]
Forms![Temp].[SR] = Me.SR
End If
End If
'********************************************************