Perhaps you could do something like this:
1) Keep the subform invisible until the 'search' button (or however
you do it) is clicked.
2) Set the subform's RS to be any ol' passthrough query, as long as
the connection is set up properly. You need not set params in the
queries properties (I forget if you even can with a passthrough,
actually)
3) When the 'search' button is clicked, open the querydef of the PTQ
in code, setting the .SQL property, something like this:
set qdf=db.QueryDefs("qMyPassThroughQuery")
qdf.SQL = "Exec procMyProcWithParams '" & Me.txtAddress1 & "', '" &
Me.txtCity & "', '" & ETC
me.MySubForm.requery
Catch me drift, mate?
hth,
brett
da***********@agric.nsw.gov.au (bentond) wrote in message news:<2b**************************@posting.google. com>...
I am trying to write a simple form that allows a user to search
through an address table. The main form has the text boxes (to be used
as where parameters) and when clicking the search button will create
an sql string that is to be used as the recordsource for the subform.
The subform is requeried and all is apples.
However I can't work out how to do this when the recordsource for the
subform has to be a pass through query. I have a static pass through
query without parametrs as the recordsource that works fine but can't
figure out how to add the parameters. Has anyone done this before?
thanks