change source object on subform using VB

G

gymphil

Can anyone help!
I have a main form with a subform and am trying to change the subforms
source object using:
forms.mainform.subform.form.sourceobject = "new query name"
the results is a run-time error 2465
application-defined or object defined error
 
A

Allen Browne

Use:
forms.mainform.subform.sourceobject = "new query name"

It is the subform control that has a SourceObject
The form in the subform control doesn't, so it can't figure out how to
assign it.
 
G

gymphil

Just the job gentlemen, thanks very much for your assistance.
you were quite correct! I had to change the record source.

Cheers

Phil
 

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