473,791 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to control form events on subforms?

I have a popup "Tools" form with a tab control that has a different subform
on each tab. The problem is that new tabs/subforms continue to be added as
users request new features - so the code on each subform's
Form_Open/Load/Current event fires whenever the popup form is opened, making
the popup form slow to open and causing problems when a function in one
subform is dependent on data or events in another subform (on a different
tab).

I know the order of events is:

Open ? Load ? Resize ? Activate ? Current

But what I need is more like:

Activate ? Open ? Load ? Current

I could move code from Open and Load to Activate, but that may cause other
issues. And the Current code would still run when the main popup is opened.
Is there a better way to control the events on these subforms? Or should I
just assign existing code to different events?

Thanks in advance.
Nov 13 '05 #1
1 2373
Still testing this...

Set the SourceObject of the subform to "frmBlank", put the working
SourceObject name in the Tag property of the Page that holds the subform,
and use this code on the Change event of the TabControl:

Dim frm As Form
Dim ctl As Control
Dim ctls As Controls
Dim varTab As Variant
Dim strSubFrm As String
Set frm = Me.Form
Set ctls = frm.Controls
Set ctl = ctls("tabTools" )
varTab = ctl.Value
strSubFrm = ctl.Pages(varTa b).Tag
If ctls(strSubFrm) .SourceObject <> strSubFrm Then _
ctls(strSubFrm) .SourceObject = strSubFrm

The subform does not open (and no code in the form's module runs) until the
user selects the tab that holds it.
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1007
by: John Hunter | last post by:
I've recently had a nasty problem with the "Invalid reference to the property Form" error in subforms - nasty because it doesn't seem to consistently happen to all forms which contain the same structure and code. Judging by the forums I've researched, it's not an uncommon error. I'm happy to say I've found a simple solution. OVERVIEW: I have a main form (no record source) which contains two subforms. The subforms are not linked, but...
5
1887
by: Weaver | last post by:
I'm new to Access. But I've been ooping for about twelve or thirteen years in another language. I've got a form with two instances of the same sub-form. It works quite well, or at least it will, when I find out how the source form can identify which of its two instances has invoked its after_insert event handler. Any ideas on this?
7
4465
by: Gerry Abbott | last post by:
Hi all, Ive got a form with several controls which contain date fields. I'm usng the activex calender control as a separate floating form, I would like to be able to click onto any of the date fields and use the calender to drop a date into it. So far, I've managed to drop the date selected from the calener, into a specified control, and requery the control to display the newly added date. Works fine using the rs object.
3
4175
by: Not Me | last post by:
Hi, Just trying to get my head around tab controls, is there anywhere which would describe the structure of how they work? I seem to be ok so far, being able to check which page I'm on etc... but I'm at a loss when trying to access controls inside the tabs. If I try to access the form directly (!...etc.) I get an error that the form can't be found. I'm not sure how I can use parent/child relationships to get at the (sub)forms which...
2
3766
by: jodyblau | last post by:
I am trying use a Calendar Control 10.0 in one of my forms. (I am using access 2002) What I want to do is have the user click a button which makes the calendar visible. Then when the user clicks on a date, it sends it to a text box and then the calendar should disappear. All of the examples I have been able to track down seem to use events that aren't available to me. Most notably, any click events.
2
4566
by: robert.waters | last post by:
Hello, If I have a form containing a Tab Control with N pages, each page containing a subform, are those subforms loaded into memory when another page has the focus? I have tried iterating through the AllForms collection, but it only shows the parent form as being loaded. I have a project with a large number of single forms that I would like to group together under one or a few parent forms, using Tab Controls to accomplish this;...
7
12312
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm thinking the Table will stay open otherwise ??? - Do I also need to use code to Assign the Child&Master Links, or can I just type the names into the subForms Control Property and just depend on the SourceObject to link to Table???
1
2083
by: (PeteCresswell) | last post by:
Posted this on microsoft.public.access a few days ago, but no nibbles. ---------------------------------------------------------------------------------------------------- I've got a form with a humongous tab control on it. Nine tabs, some of them with 3 or 4 subforms. I'm going nuts trying to fit everything on to a user's 1024x768 laptop. I'll re-size various objects, save the form, and then open
1
3247
by: veteranwebdesign | last post by:
Hello, I have a main form. I want forms to open in a subform control box. What is the code for the option group to open the subforms in the control box. I didn't create subforms, I created regular forms, but will create subforms if that is needed for this to work. My main goal is when a user clicks on a menu item and comes to a main
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10427
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10155
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9995
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.