G
Guest
Hi
I posted a question last week (12 may) about a subform being reset when I
flick between parent forms. One parent form allows editing and not filtering,
one allows filtering and not editing and another allows adding new records.
(this is to help the user distinguish between modes). However, with the
change in properties for the parent form, the subform also changes
properties, so when I filter to find a particular record then go to the
editing form, the properties for the sub form have changed so as not to allow
editing.
I had a reply last week to set the On Open event to check which form the
subform is being opened in.
the code is as follows:
Private Sub Form_Open(Cancel As Integer)
Select Case Me.Parent
Case "candidate details find"
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False
Case "candidate details edit"
Me.AllowEdits = True
Me.AllowDeletions = False
Me.AllowAdditions = False
Case "candidate details add"
Me.AllowEdits = True
Me.AllowDeletions = False
Me.AllowAdditions = True
Case Else
Exit Sub
End Select
End Sub
However now when i try to open the subform I get an error and the debugger
says
" the expression you entered has an invalid reference to the parent property"
How do I correct this?
I posted a question last week (12 may) about a subform being reset when I
flick between parent forms. One parent form allows editing and not filtering,
one allows filtering and not editing and another allows adding new records.
(this is to help the user distinguish between modes). However, with the
change in properties for the parent form, the subform also changes
properties, so when I filter to find a particular record then go to the
editing form, the properties for the sub form have changed so as not to allow
editing.
I had a reply last week to set the On Open event to check which form the
subform is being opened in.
the code is as follows:
Private Sub Form_Open(Cancel As Integer)
Select Case Me.Parent
Case "candidate details find"
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False
Case "candidate details edit"
Me.AllowEdits = True
Me.AllowDeletions = False
Me.AllowAdditions = False
Case "candidate details add"
Me.AllowEdits = True
Me.AllowDeletions = False
Me.AllowAdditions = True
Case Else
Exit Sub
End Select
End Sub
However now when i try to open the subform I get an error and the debugger
says
" the expression you entered has an invalid reference to the parent property"
How do I correct this?