Record source to a dynaset?

  • Thread starter Thread starter Jeff Klein
  • Start date Start date
J

Jeff Klein

Can I set the recordsource of the subforms to the dynaset if the main form
is sourced to a query? This way the subform does not need to run the same
query?
 
Is your question: "Can I use the main form's recordset as the recordset of
the subform?"

If yes, the answer is yes. Set the Recordset property of the subform to be
the Recordset of the main form.
 
Ken,
Thanks for the reply. I know this sounds stupid. I want the subforms to be
sources to the dynaset of the main form if I can. I have many subforms (35)
that show records for the days of the month like a calendar. If I set the
subforms' recordsource to the query then for every instance of the subform
it requires...very slow.
Works on the machine with the database but will not work on a network using
linked tables.
I was hoping I could have the main forms recordsource set to the query, and
then use the dynaset for the subforms. Might this run the query only once?
Am I on the wrong track?

Any suggestion would be very helpful.
 
So far as I know, the query should run when the form's RecordSource is
obtained. Once the recordset is then set, you should be able to set that
recordset to the subform's Recordset without "triggering" another query. But
you will need to try it to see for sure.

Code to do this is this:

Set Me.SubformName1.Form.Recordset = Me.Recordset
etc.
 
Ken Thanks for the help,
compile error = Method or data member not found...It looks like I will need
to set up some vb code that will fill the text boxes. I can do this
although this is not as cool as using subforms sourced to my data. Thank
again for the assistance, Jeff
 
The error may be caused by using the wrong name for SubformName1. This has
to be the name of the subform control (the control that holds the subform),
which may not be the same name as the form that is being used as the subform
(the subform control's Source Object).
 
Back
Top