Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a SubForm's RecordSource 3

Status
Not open for further replies.

famousb

Programmer
Mar 2, 2000
239
US
ok, I know i can change the record source of the main form with the following code:<br>Me.RecordSource = &quot;queryname&quot;<br><br>but i'm not sure how to change the record source of a subform.<br>My subform name is &quot;subDenClaims&quot;<br>and the new record source name is &quot;qbfClaimDenAll&quot;<br><br>thanks.<br>b <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Brian,<br><br>If it works at all, it should work with the following:<br><br>Me.Subdenclaims.Form.recordsource = &quot;qbfclaimdenall&quot;<br><br>Also, though, if the subform is like an &quot;order items&quot; list to the main form's &quot;order,&quot; you might want to consider applying a filter to the subform's form, instead. I think it works faster sometimes.<br><br>Me.subdenclaims.form.filter=&quot;[Keyfield]=&quot; & me.keyfield<br>me.subdenclaims.form.filteron=true<br><br><br>
 
thanks Charles, it worked great.&nbsp;&nbsp;I just couldn't get that into my head.<br><br>And actually, the new query is actually the filter for the form, it's hard to explain, but it's the only way i could do it.<br><br>thanks again <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top