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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to requery record source in subquery 1

Status
Not open for further replies.

101287

MIS
Apr 8, 2006
189
US
I have a form with a subform. I would like to requery the subform by changing the roecord source in the subquery. Can someone let me know how to do that in vba. Need to do that to refresh the suform query information.

Your guidance and assistance will be appreciated.

Luis
 
Assuming it is a stored query changing from "query1" to "query2".
Me.YourSubFormControlName.Form.recordsource = "query2"

Or you build a query dynamically

dim strSql as string
strSql = .....
Me.YourSubFormControlName.Form.recordsource = strSql
 
MajP your suggestion/recommendation work great. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top