Call Subform2 from Subform1 on Main form.

J

Juan

Hi,

I have a main form that has two subforms. I am trying to change the record
source of Subform2 on the OnCurrent Event of Subform1 .
I get a run-time error 2455 - You entered an expression that has an invalid
reference to the property Form/Report.
I have tried:

Me.Parent.Subform2.RecordSouce = "SELECT * FROM TABLE1 WHERE ID = " & Me.ID
Me.Parent.Subform2.Form.RecordSouce = "SELECT * FROM TABLE1 WHERE ID = " &
Me.ID
Me.Parent!Subform2.RecordSouce = "SELECT * FROM TABLE1 WHERE ID = " & Me.ID
Me.Parent!Subform2.Form.RecordSouce = "SELECT * FROM TABLE1 WHERE ID = " &
Me.ID

It seems that the syntax would be easy but I am really stuck on this. What
I would like to do is set the record source and refresh Subform2.

Thanks.
 
J

Juan

I have also tried:

Me.Parent.Form.Subform2.RecordSouce = "SELECT * FROM TABLE1 WHERE ID = " &
Me.ID
Me.Parent.Form.Subform2.Form.RecordSouce = "SELECT * FROM TABLE1 WHERE ID =
" &


Any suggestion?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top