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.Form.Subform2.RecordSouce = "SELECT * FROM TABLE1 WHERE ID = " &
Me.ID
Me.Parent.Form.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
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.
Any suggestions?


Thanks.
 
S

Sandra Daigle

Please see my reply in microsoft.public.access.formscoding.

Rather than posting the same message to more than one group (multiposting)
please cross-post (send the one message to all groups at once). To
Crosspost, put all of the newsgroups into the Newsgroups field in the
message header. In this way, all responses to your post will be available
together, regardless of what group the responder was in, and the rest of us
won't have to read your post multiple times.

See http://www.mvps.org/access/netiquette.htm for more information.
 

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