![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 9
|
Hi
I need to perform some checks in textboxes contained in a multipage. I'm trying to reference currently active control by using this command: ME.ACTIVECONTROL.NAME But, despite the textboxes have the focus, the command always return Mutlipage1 as the activecontrol. How can I reference the textbox directly as the active control? Tks |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi
This should work Me.MultiPage1.Pages(Me.MultiPage1.Value).ActiveControl.Name |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 9
|
Whatif this combobox is inside a frame that is inside a page that is inside a multipage
Tks a lot |
|
|
|
|
|
#4 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Maybe:
Me.MultiPage1.Pages(Me.MultiPage1.Value).Frame1.ActiveControl.Name |
|
|
|
|
|
#5 |
|
New Member
Join Date: Apr 2002
Posts: 9
|
Yeah this works, but the point is that I have may frames and I'd like to refer to objects inside all these different frames.
Tks Dave |
|
|
|
|
|
#6 |
|
New Member
Join Date: Oct 2005
Posts: 1
|
Code:
Dim LastFocussedControl As Control
'This allows a control to be inside a frame inside a multipage
'For nested multipages use a whileloop for example, I'm sure you can workout
Set LastFocussedControl = ActiveControl
If (Left(LastFocussedControl.Name, Len("Multipage")) = "MultiPage") Then
Set LastFocussedControl = LastFocussedControl.Pages(LastFocussedControl.Value).ActiveControl
End If
If (Left(LastFocussedControl.Name, Len("Frame")) = "Frame") Then
Set LastFocussedControl = LastFocussedControl.ActiveControl
End If
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|