Problems when OnCurrent Event is Used in Subforms

llyal

Registered User.
Local time
Today, 07:08
Joined
Feb 1, 2000
Messages
72
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
 
The solution has to deal with using unbound text fields on the main form, and having the subforms pass information and update themselves off of these; i found this workaround in a book i had; i must admit, having to do all this awkwardness to make Access perform sure is ghetto;
 

Users who are viewing this thread

Back
Top Bottom