How to change a subform RecordSource

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hi,

I want to change a subform RecordSource through a form button,
hope someone can help!!

Thank!!

Gary
 
In the OnClick event of your button, add something like this:

Me.PartSubform.Form.RecordSource = "SELECT Part.ProductID, Part.PartID,
Part.PartName, Part.Price FROM Part;"
Me.PartSubform.Form.Requery

You can also just give the name of a query.
Me.PartSubform.Form.RecordSource = "qrySubformQuery"

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Thank for help!!

Roger Carlson said:
In the OnClick event of your button, add something like this:

Me.PartSubform.Form.RecordSource = "SELECT Part.ProductID, Part.PartID,
Part.PartName, Part.Price FROM Part;"
Me.PartSubform.Form.Requery

You can also just give the name of a query.
Me.PartSubform.Form.RecordSource = "qrySubformQuery"

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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

Back
Top