Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default capturing TabStrip events inside an MsForm

Hi,

Im trying to display results from a database query in a sort of a 'form'.
I need it to be displayed on the actual worksheet, not as a separate window
as would be the case when using the UserForm...so Im using an MSFrame
(Microsoft Forms 2.0 Frame) directly on the worksheet and I'm putting all my
info in there.

Now,
In order to display different sets of data in different tabs Im trying to
use a TabStrip (the form looks the same for all the sets)...

The problem I am having is how to capture the TabStrip events when the
TabStrip is located inside an MsFrame...
If it was an UserForm it would be as simple as

Private Sub TabStrip1_Change()

but in the case of the Frame I cannot access the controls directly.
I generally access them using

Me.frame1.Controls("TabStrip1")

So, any ideas how to go about this?

Thanks!!!

ps. Using Excel 2003
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default capturing TabStrip events inside an MsForm

I would use a Multipage control rather than a TabStrip control. You
can access the MultiPage's events normally, regardless of whether it
is in a frame.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Thu, 11 Feb 2010 16:12:01 -0800, Strobo
wrote:

Hi,

Im trying to display results from a database query in a sort of a 'form'.
I need it to be displayed on the actual worksheet, not as a separate window
as would be the case when using the UserForm...so Im using an MSFrame
(Microsoft Forms 2.0 Frame) directly on the worksheet and I'm putting all my
info in there.

Now,
In order to display different sets of data in different tabs Im trying to
use a TabStrip (the form looks the same for all the sets)...

The problem I am having is how to capture the TabStrip events when the
TabStrip is located inside an MsFrame...
If it was an UserForm it would be as simple as

Private Sub TabStrip1_Change()

but in the case of the Frame I cannot access the controls directly.
I generally access them using

Me.frame1.Controls("TabStrip1")

So, any ideas how to go about this?

Thanks!!!

ps. Using Excel 2003

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default capturing TabStrip events inside an MsForm


I guess I can, but then I have to have a copy of the entire form for each
page...with tabstrip for each tab I could simply update the fields with the
new values.

Anyway, I'll look into this...

But I still welcome any other ideas!!! :-)

Thanks Chip!

"Chip Pearson" wrote:

I would use a Multipage control rather than a TabStrip control. You
can access the MultiPage's events normally, regardless of whether it
is in a frame.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Thu, 11 Feb 2010 16:12:01 -0800, Strobo
wrote:

Hi,

Im trying to display results from a database query in a sort of a 'form'.
I need it to be displayed on the actual worksheet, not as a separate window
as would be the case when using the UserForm...so Im using an MSFrame
(Microsoft Forms 2.0 Frame) directly on the worksheet and I'm putting all my
info in there.

Now,
In order to display different sets of data in different tabs Im trying to
use a TabStrip (the form looks the same for all the sets)...

The problem I am having is how to capture the TabStrip events when the
TabStrip is located inside an MsFrame...
If it was an UserForm it would be as simple as

Private Sub TabStrip1_Change()

but in the case of the Frame I cannot access the controls directly.
I generally access them using

Me.frame1.Controls("TabStrip1")

So, any ideas how to go about this?

Thanks!!!

ps. Using Excel 2003

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default capturing TabStrip events inside an MsForm

Hi Strobo,

Any reason you are not using a pivot table for this?

Ed Ferrero
www.edferrero.com
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default capturing TabStrip events inside an MsForm

If you are really intent on putting your Tabstrip in the Frame you can trap
its events in a 'WithEvents' class
Eg, code in Class1 and a normal module as indicated, run StartEvents
(assumes TabStrip1 is *embedded* in Frame1)

''' code in Class1
Public WithEvents tabStrip As MSForms.tabStrip

Private Sub tabStrip_Change()
With tabStrip
MsgBox .Tabs(.Value).Caption
End With
End Sub

''' end Class1

'' code in a normal module
Private cls1 As Class1

Sub StartEvents()
Dim oleF As OLEObject

Set cls1 = New Class1
Set oleF = ActiveSheet.OLEObjects("Frame1")
Set cls1.tabStrip = oleF.Object.Controls("TabStrip1")

End Sub

Sub StopEvents()
Set cls1 = Nothing
End Sub

I would have thought though Chip Pearson's suggestion is simpler, or group
all controls within a drawing shape, formatted to look like a frame.

Regards,
Peter T


"Strobo" wrote in message
...
Hi,

Im trying to display results from a database query in a sort of a 'form'.
I need it to be displayed on the actual worksheet, not as a separate
window
as would be the case when using the UserForm...so Im using an MSFrame
(Microsoft Forms 2.0 Frame) directly on the worksheet and I'm putting all
my
info in there.

Now,
In order to display different sets of data in different tabs Im trying to
use a TabStrip (the form looks the same for all the sets)...

The problem I am having is how to capture the TabStrip events when the
TabStrip is located inside an MsFrame...
If it was an UserForm it would be as simple as

Private Sub TabStrip1_Change()

but in the case of the Frame I cannot access the controls directly.
I generally access them using

Me.frame1.Controls("TabStrip1")

So, any ideas how to go about this?

Thanks!!!

ps. Using Excel 2003



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
Capturing excel insert/delete events. Gaurav Nanda[_2_] Excel Worksheet Functions 1 July 10th 09 11:09 PM
Capturing Insert/Delete Events in Excel Sheet using c# Gaurav Nanda[_2_] Excel Worksheet Functions 0 July 10th 09 06:14 AM
Capturing Excel Copy/Paste/Cut events RNG Excel Programming 8 June 23rd 05 06:08 AM
Capturing Sheet Events MWE Excel Programming 4 January 18th 04 07:56 PM
Capturing Checkbox Events Mark D'Agosta Excel Programming 8 October 13th 03 01:29 AM


All times are GMT +1. The time now is 05:15 AM.

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

About Us

"It's about Microsoft Excel"