G
Guest
I created an option box which would allow users to switch between an "edit"
and "view-only" capability. However, once the "view only" button was
selected, I could no longer switch back to the "edit" mode. I got around
this by putting the option box into an unbound subform. I used the coding
below for the option box, and it worked perfectly.
The thing is, I'd like to add this capability to many forms. Is there a way
for me to use the same subform, and have the coding refer to whatever the
active 'parent' form is?
The Me! reference is to the subform, unfortunately. I could create a new
subform for each parent, but I'm hoping there's an easier way. Here is the
coding I used on the subform option box. Any assistance is greatly
appreciated.
Private Sub optVE_Click()
If optVE = 1 Then
Forms!frmProjectInfo.AllowAdditions = False
Forms!frmProjectInfo.AllowDeletions = False
Forms!frmProjectInfo.AllowEdits = False
ElseIf optVE = 2 Then
Forms!frmProjectInfo.AllowAdditions = True
Forms!frmProjectInfo.AllowDeletions = True
Forms!frmProjectInfo.AllowEdits = True
End If
End Sub
and "view-only" capability. However, once the "view only" button was
selected, I could no longer switch back to the "edit" mode. I got around
this by putting the option box into an unbound subform. I used the coding
below for the option box, and it worked perfectly.
The thing is, I'd like to add this capability to many forms. Is there a way
for me to use the same subform, and have the coding refer to whatever the
active 'parent' form is?
The Me! reference is to the subform, unfortunately. I could create a new
subform for each parent, but I'm hoping there's an easier way. Here is the
coding I used on the subform option box. Any assistance is greatly
appreciated.
Private Sub optVE_Click()
If optVE = 1 Then
Forms!frmProjectInfo.AllowAdditions = False
Forms!frmProjectInfo.AllowDeletions = False
Forms!frmProjectInfo.AllowEdits = False
ElseIf optVE = 2 Then
Forms!frmProjectInfo.AllowAdditions = True
Forms!frmProjectInfo.AllowDeletions = True
Forms!frmProjectInfo.AllowEdits = True
End If
End Sub