How to change a subform RecordSource

G

Gary

Hi,

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

Thank!!

Gary
 
R

Roger Carlson

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
 
Top