Problems when OnCurrent Event is Used in Subforms
Access97
I get error when i open form that contains a subform that updates another subform using the OnCurrent event;
The setup is:
Mainform with two Subforms; Mainform does not have a RecordSource; only used to hold subforms;
SubformA that has OnCurrent Event code that updates SubformB; no master/child relationship with Mainform;
SubformB which has its RecordSource Property changed by SubformA; no master/child relationship with Mainform;
Here is the OnCurrent event code:
Private Sub Form_Current()
Forms.frmMainform.frmSubformB.Form.RecordSource = "SELECT * From tblList WHERE <SQL filter>;"
End Sub
When i open the main form, i get: Error 2455, you entered an expression that has an invalid reference to the property Form/Report; after the main form opens, the subforms will update with no errors;
Maybe i am not correctly changing property of subform; i cannot use Forms!frmMainform!frmSubformB.Form!RecordSource format because i am trying to change a property, not a control;
Am i doing something wrong, or is this "another" Access bug?
Thank you!
Llyal
Access97
I get error when i open form that contains a subform that updates another subform using the OnCurrent event;
The setup is:
Mainform with two Subforms; Mainform does not have a RecordSource; only used to hold subforms;
SubformA that has OnCurrent Event code that updates SubformB; no master/child relationship with Mainform;
SubformB which has its RecordSource Property changed by SubformA; no master/child relationship with Mainform;
Here is the OnCurrent event code:
Private Sub Form_Current()
Forms.frmMainform.frmSubformB.Form.RecordSource = "SELECT * From tblList WHERE <SQL filter>;"
End Sub
When i open the main form, i get: Error 2455, you entered an expression that has an invalid reference to the property Form/Report; after the main form opens, the subforms will update with no errors;
Maybe i am not correctly changing property of subform; i cannot use Forms!frmMainform!frmSubformB.Form!RecordSource format because i am trying to change a property, not a control;
Am i doing something wrong, or is this "another" Access bug?
Thank you!
Llyal