E
Eric Blitzer
Windows 2000
Office 2000
Main form - a-schedule-new
Subform1 - A-main-subform
Subform2 - A-main-subform2
I have a form with two subforms in it. Base on if there is
a value in the ApprovedBy field I want to lock or unlock
the subforms. I do not want to lock the main form. Below
is my present code.
Thew error I get when openeing the form is
You entered an expressionthat has an invalid reference to
the propertyForm/Report. The debug brings to this line in
my procedure
[a-schedule-new].[A-main-subform].Form.AllowEdits = False
Can anyone help me accomplish this.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Staff] = '" & Me![Staff] & "'"
Me.Bookmark = rs.Bookmark
If IsNull(Me.ApprovedBy) Then
Me.AllowEdits = True
Me.[A-main-subform].Form.AllowEdits = True
Me.[A-main-subform2].Form.AllowEdits = True
Else
Me.AllowEdits = True
[a-schedule-new].[A-main-subform].Form.AllowEdits = False
[a-schedule-new].[A-main-subform2].Form.AllowEdits = False
End If
Office 2000
Main form - a-schedule-new
Subform1 - A-main-subform
Subform2 - A-main-subform2
I have a form with two subforms in it. Base on if there is
a value in the ApprovedBy field I want to lock or unlock
the subforms. I do not want to lock the main form. Below
is my present code.
Thew error I get when openeing the form is
You entered an expressionthat has an invalid reference to
the propertyForm/Report. The debug brings to this line in
my procedure
[a-schedule-new].[A-main-subform].Form.AllowEdits = False
Can anyone help me accomplish this.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Staff] = '" & Me![Staff] & "'"
Me.Bookmark = rs.Bookmark
If IsNull(Me.ApprovedBy) Then
Me.AllowEdits = True
Me.[A-main-subform].Form.AllowEdits = True
Me.[A-main-subform2].Form.AllowEdits = True
Else
Me.AllowEdits = True
[a-schedule-new].[A-main-subform].Form.AllowEdits = False
[a-schedule-new].[A-main-subform2].Form.AllowEdits = False
End If