A
ATSBC03
I have read many of the other posts in regards to locking and unlocking forms
but i am still unable to get it to do what i want. Let me explain my setup.
I am working on form to help capture incidents that we have. Each form can
have up to 4 subforms. 1 subform is embedded on the main form and the others
are on tabs and can be opened using an option group. I have one main number
as a key to group all the forms together in a 1-1 relationship.
On the main form I have added a combo box with "open" and "close" to help
prevent accidental erasing of already entered records. The form does not have
an update or close button. New records are added using the record selectors
and close buttons already there.
I set my open/close combo box to open. It can be changed to close which
calls on the following code in the after update event of the combo box and
the form current event :
If cboOpenClosed = "Closed" Then
Me.AllowEdits = False
Me.FallRisKParametersSub.Locked = True
Me.subFormLab.Locked = True
Me.subHospitalTransfer.Locked = True
Me.subRiskManagement.Locked = True
Me.MgrFollowUpSub.Locked = True
Me.Form.AllowEdits = False
ElseIf cboOpenClosed = "Open" Then
Me.AllowEdits = True
Me.FallRisKParametersSub.Locked = False
Me.subFormLab.Locked = False
Me.subHospitalTransfer.Locked = False
Me.subRiskManagement.Locked = False
Me.MgrFollowUpSub.Locked = False
Me.Form.AllowEdits = True
End If
This code successfully locks or keeps unlocked my forms.
The problem:
If i find out that i need to add something to a record that is already
closed i cannot select open on the combo box. Is there a way for me to have
that unlocked with all other controls locked? I have to many controls and
really do not want to have to code each control to locked. Any help would be
appreciated. I have been working on this for weeks now and have not made it
anywhere. If you need more information let me know.
but i am still unable to get it to do what i want. Let me explain my setup.
I am working on form to help capture incidents that we have. Each form can
have up to 4 subforms. 1 subform is embedded on the main form and the others
are on tabs and can be opened using an option group. I have one main number
as a key to group all the forms together in a 1-1 relationship.
On the main form I have added a combo box with "open" and "close" to help
prevent accidental erasing of already entered records. The form does not have
an update or close button. New records are added using the record selectors
and close buttons already there.
I set my open/close combo box to open. It can be changed to close which
calls on the following code in the after update event of the combo box and
the form current event :
If cboOpenClosed = "Closed" Then
Me.AllowEdits = False
Me.FallRisKParametersSub.Locked = True
Me.subFormLab.Locked = True
Me.subHospitalTransfer.Locked = True
Me.subRiskManagement.Locked = True
Me.MgrFollowUpSub.Locked = True
Me.Form.AllowEdits = False
ElseIf cboOpenClosed = "Open" Then
Me.AllowEdits = True
Me.FallRisKParametersSub.Locked = False
Me.subFormLab.Locked = False
Me.subHospitalTransfer.Locked = False
Me.subRiskManagement.Locked = False
Me.MgrFollowUpSub.Locked = False
Me.Form.AllowEdits = True
End If
This code successfully locks or keeps unlocked my forms.
The problem:
If i find out that i need to add something to a record that is already
closed i cannot select open on the combo box. Is there a way for me to have
that unlocked with all other controls locked? I have to many controls and
really do not want to have to code each control to locked. Any help would be
appreciated. I have been working on this for weeks now and have not made it
anywhere. If you need more information let me know.