Changing Sub Form RowSource

  • Thread starter Thread starter Dave Ruhl
  • Start date Start date
D

Dave Ruhl

Hello, I'm trying to change the RowSource of an un-linked
subform based on search criteria entered on the main
form. The main form uses the criteria to show the
results in one format, the subform shows it in another
format.

I've tried variations of Forms!frmMain!frmSub.RowSource
and Me.frmSub.RowSource, but the syntax is not correct.
Can someone show me the correct mwthod ? Thanks

(Access 2002/ Windows XP)
 
There are two names involved: the name of the control on the main form that
holds the subform, and the name of the subform itself. By default, these
will be the same when you drag-and-drop one form onto another: I
deliberately rename the subcontrol "container" just to avoid problems.

Assuming frmSub is the name of the control that's holding your subform, try:

Forms!frmMain!frmSub.Form.RowSource
 
Thanks !!!

Doug, thanks for giving me the syntax hint I needed, and
Hugh, thanks for pointing out that I was using the
wrong 'source'.

Both tips helped, and it works perfectly now. Thanks
again !
 
Back
Top