I
ISSB Programmer
I am currently using the following code to change the AllowEdits property on
any form. The form calls the Sub procedure through a button's OnClick event.
Sub UnlockForm(strFormName As String)
On Error GoTo Err_unlockform
If Forms(strFormName).AllowEdits = False Then
Forms(strFormName).AllowEdits = True
MsgBox "Form is now unlocked for editing."
End If
Exit_unlockform:
Exit Sub
Err_unlockform:
MsgBox Err.Description
Resume Exit_unlockform
End Sub
I am trying to call this Sub procedure from a button on a subform. I was
going to use an if/else statement to execute the following code if the
calling form is a subform:
If Forms(strFormName)(strSubFormName).AllowEdits = False Then
Forms(strFormName)(strSubFormName).AllowEdits = True
MsgBox "Form is now unlocked for editing."
End If
Is there an easier way of doing this? Can I set strFormName to somehow point
to the subform instead of creating another parameter? Thanks.
any form. The form calls the Sub procedure through a button's OnClick event.
Sub UnlockForm(strFormName As String)
On Error GoTo Err_unlockform
If Forms(strFormName).AllowEdits = False Then
Forms(strFormName).AllowEdits = True
MsgBox "Form is now unlocked for editing."
End If
Exit_unlockform:
Exit Sub
Err_unlockform:
MsgBox Err.Description
Resume Exit_unlockform
End Sub
I am trying to call this Sub procedure from a button on a subform. I was
going to use an if/else statement to execute the following code if the
calling form is a subform:
If Forms(strFormName)(strSubFormName).AllowEdits = False Then
Forms(strFormName)(strSubFormName).AllowEdits = True
MsgBox "Form is now unlocked for editing."
End If
Is there an easier way of doing this? Can I set strFormName to somehow point
to the subform instead of creating another parameter? Thanks.