L
ladybug via AccessMonster.com
I have a form called frm_ope, that can be opened by two different buttons. I
want one button to allow users only to view the data (no add, no delete, no
edit). The other button I want the users to be able to add, delete, and edit.
I know I cannot set the properties to frm_ope, to allow additions, deletions,
and edits. Then it would not work for the button where I do not want this
allowed. What code can I use in the buttons to determine on the open of the
form, whether the user is allowed to make additions, deletions, and edits?
Right now in the view only button I have this code:
On Error GoTo Err_Command15_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmView"
stLinkCriteria = "[Number]=" & Me![cboSearch]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
Once I have put the code in, what should I do in the forms properties for
Allow additions, deletions, edits?
want one button to allow users only to view the data (no add, no delete, no
edit). The other button I want the users to be able to add, delete, and edit.
I know I cannot set the properties to frm_ope, to allow additions, deletions,
and edits. Then it would not work for the button where I do not want this
allowed. What code can I use in the buttons to determine on the open of the
form, whether the user is allowed to make additions, deletions, and edits?
Right now in the view only button I have this code:
On Error GoTo Err_Command15_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmView"
stLinkCriteria = "[Number]=" & Me![cboSearch]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
Once I have put the code in, what should I do in the forms properties for
Allow additions, deletions, edits?