Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Do subforms have a "load" or "made visible" event?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maury Markowitz - 30 May 2007 20:40 GMT
I have a subform control that I switch between one of several forms based on
the state of the database record. More specifically, the subform shows a
number of editable rows with a different arrangement depending on the number
of items in an order. Changing this is simple enough, setting the
SourceObject string of the subview.

What's not so obvious is WHEN to do this. The subform is in a tab, so it
seems that I should only do it when it becomes visible. Is there some even
that the subform control receives when it becomes visible? OnLoad would be
great, but I don't see it.

Maury
Dale Fye - 30 May 2007 20:53 GMT
The subform should have Enter and Exit events.  It also contains load and
open events, but these are only visible when you are actually designing the
form that will become a subfom.

When I use a tab control that contains multiple subforms, I generally only
leave the source object for all the tabs except the first one blank at design
time, then, in the tab controls change event, I check to see what tab the
user has selected (compare the value of the tab control to the page indices
of each of the tabs) and if the source object for the subform on that tab is
still blank, I fill it in.

HTH

Signature

Email address is not valid.
Please reply to newsgroup only.

> I have a subform control that I switch between one of several forms based on
> the state of the database record. More specifically, the subform shows a
[quoted text clipped - 8 lines]
>
> Maury
Maury Markowitz - 31 May 2007 18:04 GMT
> When I use a tab control that contains multiple subforms, I generally only
> leave the source object for all the tabs except the first one blank at design
> time, then, in the tab controls change event, I check to see what tab the
> user has selected (compare the value of the tab control to the page indices
> of each of the tabs) and if the source object for the subform on that tab is
> still blank, I fill it in.

Ok, I'll give this a whirl. Thanks!

Maury
david@epsomdotcomdotau - 30 May 2007 23:07 GMT
Subforms are loaded before the main form, so that
doesn't help any (this is why it is a good idea to leave
your subform controls empty until you need them).

If you have them on different tabs, you should be
looking at the tab events.

(david)

> I have a subform control that I switch between one of several forms based on
> the state of the database record. More specifically, the subform shows a
[quoted text clipped - 8 lines]
>
> Maury
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.