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
 
Back
Top