Stop Subform Queries Running

  • Thread starter Thread starter Skyrunner
  • Start date Start date
S

Skyrunner

Guest
Syoping Subform Querties running

I have a main form, with a tabbed section at the bottem, each with its own subform that contain a query,that search a table by different parameters; name, number, postcode etc.

However, I want the queries to run when the tab(or a button) is clicked, not all at once when the main form is loaded.. is there an easy way to do this?

I have got until Friday to ort this out in my project, so if anyone can help it'd be great, please could you explain any ideas well, as I am fairly new to Access, tho I know a fair bit of VB :)

Thanks,
 
I think the subform queries will execute when they get assigned a recordsource. This will happen when they are opened (if you've entered something into the recordsource property of the subform) or it could happen when you use VBA code to assign them a recordsource. If you want to control when the query gets run, then use VBA code to assign the subform their recordsource when the corresponding tab gets clicked.

The default subform tab will be probably be visible when the entire form loads, so you might want to assign that one right away. The code to assign a recordsource to a subform is:
Me.subformName.Form.Recordsource=saved query name or SQL string
 
What's syoping meant to mean?
 
Works :D Thanks, saved me a hell of a lot of time, such a simple solution to it.. I guess Access incorporates more VB code than I had thought, might be able to add some interesting stuff to it :)

Thnks again
 

Users who are viewing this thread

Back
Top Bottom