subform record source tabbed page

G

GBA

In a main form that is tabbed; in tab C it is nothing but a subform C, with a
record source of query C.

To avoid calling all the data in subform C everytime the mainform is opened
I have the record source in the subform blank, and put in vba at the OnClick
of tab C that subform.recordsource="queryC".

this works fine.

When in tab C, looking at the data in subform C - - - and if I change main
form records to another record - - the data is in subform C - - which is also
fine.

My question is when I return to tab A; - - - when I change mainform
records...am I still calling in all the data for tabC's subform C?....do I
need to put in vba in the tab A OnClick that redefines the records source of
subform C to null?...or "" ?

tia
 
J

JonWayn

If I understand you correctly, when your main form loads, the subform on tab
C has an empty recordsource and is not set to load any data until tab C is
made active. Then, if you navigate away from tab C again, without any effort
on your part, that subform on tab C will still be bound to tha data. If you
are some low on resources that you need to release those resources everytime
you tab away, then you will need to set subform C's recordsource property to
empty in the Change event of the tab control or with some other event that
indicates the deactivation of tab C. If you are not desperate for resources
though, Id suggest that you leave the subform loaded after its initial
connection (the first activation of tab C). Unless tab C is very rarely used,
it would be more efficient to leave the subform connected once you establish
a connection
 
G

GBA

subform C / query C is a join of several tables. It is alot of data to pull
from the BE and as tab C is not frequently looked at - - I only want to pull
that data when needed.

I assume that everytime you change the mainform's record - it repulls all
the tables data each time

I just wasn't sure whether I had to remove the subform's record source with
vba when the user moves to another tab or not....or whether when tab C was
defacto inactive that the record source returned to its blank state
automatically...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top