473,662 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting subform focus

I have a form with 4 subforms on a tab control. How can I detect which
sub/tab has the focus from the main form?

Many thanks.

Keith.
Jan 26 '07 #1
3 4950
Examine the ActiveControl of the main form to determine what control has
focus, e.g.:
Debug.Print Me.ActiveContro l.Name

Examine the Value of the tab control to determine which page is currently
selected, e.g.:
If Me.Tab1.Value = Me.Page2.PageIn dex Then ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Keith Wilby" <he**@there.com wrote in message
news:45******** **@glkas0286.gr eenlnk.net...
>I have a form with 4 subforms on a tab control. How can I detect which
sub/tab has the focus from the main form?

Many thanks.

Keith.
Jan 26 '07 #2
Hi Keith,

If Me.TabControl = 0 then the first page(tab) of your tabcontrol is the active one
If Me.TabControl = 2 then the third page(tab) of your tabcontrol is the active one
So check the value of your Tabcontrol.

Arno R
"Keith Wilby" <he**@there.com schreef in bericht news:45******** **@glkas0286.gr eenlnk.net...
>I have a form with 4 subforms on a tab control. How can I detect which
sub/tab has the focus from the main form?

Many thanks.

Keith.

Jan 26 '07 #3
"Arno R" <ar***********@ tiscali.nlwrote in message
news:45******** **************@ text.nova.plane t.nl...

Thanks guys.

Keith.
Jan 29 '07 #4

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

Similar topics

15
24823
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that contains the subform is named Clients. I have this code in the Add Client btn: If Forms!Clients.subformVisits!VisitDirty = True Then MsgBox "Visit subform is dirty!"
2
8076
by: Mark B | last post by:
I have a form with a subform (normal) that itself has a subform (datasheet). I can't get a delete command button to work with the following code. It says "delete not available now". Any suggestions? '***************************************************************** Public Function DeleteRecord() Dim frm As Form, subfrm As Form
3
2622
by: Steve Miles | last post by:
I've got a tabbed form with the 2nd tab containing a subform. I'm trying to avoid the need to use the mouse to set focus to the first field on the subform. I can use <CTRL><TAB> to open the 2nd tab, but I can't get the first field to receive focus until I click in it. Here's what I've already tried/checked: 1) I've commented out the "On Current" event VB code. 2) The first field IS a tab stop and it's first on the tab order.
2
1305
by: js | last post by:
need help going from one txtbox in one subform to another textbox in another subform so i have main frm -inside there are: subfrm1 (textboxes: a1 a2 a3 ) and subfrm2 (b1 b2 b3) how do i go from txtbox a2 to b2 -- if a condition is met at a2?
1
3037
by: MP | last post by:
I have a main form that has a subform which also has a subform: the main form is the first subform is the second subform is When I click on the button »AddNewSubSubRecord« (add a new record in the second subform , the code generates the message: Can't find the field »POG-03 Work Subform« reffrred to in your expression.
1
1685
by: Dean Slindee | last post by:
In my application there is a main form with a tabcontrol. On each page in the tabcontrol is a panel upon which is painted a "sub" form. The main form acts as the "application host", while the subforms are where data values contained in underlying tables are displayed, inserted, updated or deleted. I don't make the user press an "Edit" button to enable the textboxes on the subforms. Rather, the subforms and their textboxes are always...
1
3233
by: google | last post by:
I have a form with several subforms. Users enter the data, then on the parent there is a command button that runs code to generate a .pdf document from a report based on the data they are working with. If a user enters data in a subform, then directly clicks the command button on the parent form, the data in the subform is not included in their document. I THOUGHT that as soon as focus left the subform, any pending changes to the data...
8
9759
by: OldBirdman | last post by:
This should be so, so simple I hesitate to ask. I have a Form named "fNavButtons" used as a SubForm in control named "subformNavButtons". subformNavButtons is a control on my main form named "fAAA". fNavButtons has 2 CommandButtons, cmdNextRec and cmdPrevRec. These are on a subform to allow an AutoRepeat to continue when form fAAA gets another record. If I am at the first record, I want cmdPrevRec.Enabled = False, and if I am at the...
2
2170
by: Element | last post by:
I have a master form with a simple subform that displays line items in datasheet mode. Everything works fine, except that when the subform has the focus, the standard Access sorting and filtering toolbar buttons are not available. I also tried a custom toolbar, but they are disabled there too. It seems odd, because when the same records are diplayed on their own "master" form in datasheet mode, those same toolbar buttons are available....
0
8432
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
8344
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
8764
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8546
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
8633
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...
1
6186
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
5654
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4180
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...
2
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.