Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default ActiveControl again

The following code fails at line 2 with Object vaiable not set and I cannot
find the correct syntax.
The proc refers to 2 optionbutton labels in a frame on a multipage hence
needing to use SelectedItem.

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay" Then
If fraOneDayTwoDay.ActiveControl.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

T.I.A.

Geoff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default ActiveControl again

You don't need activecontrol:

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay" Then
If fraOneDayTwoDay.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

--
Regards,
Tom Ogilvy



"Geoff" wrote:

The following code fails at line 2 with Object vaiable not set and I cannot
find the correct syntax.
The proc refers to 2 optionbutton labels in a frame on a multipage hence
needing to use SelectedItem.

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay" Then
If fraOneDayTwoDay.ActiveControl.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

T.I.A.

Geoff

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default ActiveControl again

Thank you.

Geoff

"Tom Ogilvy" wrote:

You don't need activecontrol:

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay" Then
If fraOneDayTwoDay.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

--
Regards,
Tom Ogilvy



"Geoff" wrote:

The following code fails at line 2 with Object vaiable not set and I cannot
find the correct syntax.
The proc refers to 2 optionbutton labels in a frame on a multipage hence
needing to use SelectedItem.

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay" Then
If fraOneDayTwoDay.ActiveControl.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

T.I.A.

Geoff

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default ActiveControl again

Tom
I thought at first that was the solution but by coincidence it was
referencing the same tabindexc of the multipage not the tabindex of the frame
control . So i'm still stuck on this.

Geoff

"Geoff" wrote:

Thank you.

Geoff

"Tom Ogilvy" wrote:

You don't need activecontrol:

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay" Then
If fraOneDayTwoDay.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

--
Regards,
Tom Ogilvy



"Geoff" wrote:

The following code fails at line 2 with Object vaiable not set and I cannot
find the correct syntax.
The proc refers to 2 optionbutton labels in a frame on a multipage hence
needing to use SelectedItem.

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay" Then
If fraOneDayTwoDay.ActiveControl.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

T.I.A.

Geoff

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveControl again

What are you actually trying to determine/do?

--
Regards,
Tom Ogilvy

"Geoff" wrote in message
...
Tom
I thought at first that was the solution but by coincidence it was
referencing the same tabindexc of the multipage not the tabindex of the

frame
control . So i'm still stuck on this.

Geoff

"Geoff" wrote:

Thank you.

Geoff

"Tom Ogilvy" wrote:

You don't need activecontrol:

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay"

Then
If fraOneDayTwoDay.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

--
Regards,
Tom Ogilvy



"Geoff" wrote:

The following code fails at line 2 with Object vaiable not set and I

cannot
find the correct syntax.
The proc refers to 2 optionbutton labels in a frame on a multipage

hence
needing to use SelectedItem.

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay"

Then
If fraOneDayTwoDay.ActiveControl.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

T.I.A.

Geoff





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default ActiveControl again

To get the control with focus when tabbing through the form. The problem is
how deep to go with activecontrol. The optionbuttons are within a frame on a
multipage.

So far I have:
Me.ActiveControl.Name returns "MultiPage1"
Me.MultiPage1.SelectedItem.Name returns "Page1"
Me.MultiPage1.SelectedItem.ActiveControl.Name returns "fraOneDayTwoDay"

but I cannot get to the controls within the frame fraOneDayTwoDay which are
named as optOneDay and optTwoDay.

Geoff


"Tom Ogilvy" wrote:

What are you actually trying to determine/do?

--
Regards,
Tom Ogilvy

"Geoff" wrote in message
...
Tom
I thought at first that was the solution but by coincidence it was
referencing the same tabindexc of the multipage not the tabindex of the

frame
control . So i'm still stuck on this.

Geoff

"Geoff" wrote:

Thank you.

Geoff

"Tom Ogilvy" wrote:

You don't need activecontrol:

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay"

Then
If fraOneDayTwoDay.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

--
Regards,
Tom Ogilvy



"Geoff" wrote:

The following code fails at line 2 with Object vaiable not set and I

cannot
find the correct syntax.
The proc refers to 2 optionbutton labels in a frame on a multipage

hence
needing to use SelectedItem.

If Me.MultiPage1.SelectedItem.ActiveControl.Name = "fraOneDayTwoDay"

Then
If fraOneDayTwoDay.ActiveControl.TabIndex = 3 Then
lblOneDayBack.Visible = True
Else
lblTwoDayBack.Visible = True
End If
End If

T.I.A.

Geoff




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveControl problem DAACKM Excel Discussion (Misc queries) 3 September 9th 08 01:15 AM
ActiveControl Geoff Excel Programming 2 March 24th 06 01:48 PM
Calendar Control & ActiveControl Marcus B Excel Programming 0 March 15th 06 10:08 AM
userform1.activecontrol.name Italian Job Excel Programming 3 November 14th 03 12:43 PM


All times are GMT +1. The time now is 07:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"