Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 23rd, 2004, 11:57 AM
Authorized User
 
Join Date: Aug 2003
Location: , PA, USA.
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Default Frame Index

Here is a situation : I have a form with multipage control (Multipage has 6 pages). On each page i have 2 frames. I want to access the frames (through code) in a sequence (for eg : page1.frame1 and then page1.frame2 and then page2.frame2.page1 and so on.........). I am using the below code and what happens is that it picks the sequence as frames were created..(for eg you created a frame on page 2 and then you went back and created another frame on frame 1...it takes the the frame created on page 2 first and then the frame created on page 1) but i want the other way around. I went and looked into properties to set the index but that does'nt work.

Help will be appreciated...

Code


Private Sub CommandButton1_Click()
Dim ctrl As Control
Dim msg As String
For Each ctrl In UserForm1.Controls
    If LCase(Mid(ctrl.Name, 1, 3)) = "fra" Then
        msg = msg & vbNewLine & ctrl.Name
    End If
Next ctrl
MsgBox msg
End Sub

Ajitpal S Padda
__________________
Ajitpal S Padda
Reply With Quote
  #2 (permalink)  
Old February 25th, 2004, 12:39 PM
Authorized User
 
Join Date: Feb 2004
Location: Sacramento, CA, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I work around this problem by giving the frames specific names, essentially concatenating the word "frame" and the index I want it to have. If I insert another frame, I do have to review/revise all the frame names to make sure they are "numbered" in the order I want them.



Dave
Reply With Quote
  #3 (permalink)  
Old February 25th, 2004, 12:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: London, , United Kingdom.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I suppose you could always put your frame names into an array or collection as part of the form's init routine. That way you could more easily alter the 'running order' and add/delete at will.


There are two secrets to success in this world:
1. Never tell everything you know
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set one frame src from other frame akumarp2p ASP.NET 1.x and 2.0 Application Design 2 March 13th, 2007 04:13 AM
offsite link to iframes index page and child frame raiderray Javascript How-To 1 January 3rd, 2006 05:01 PM
parsing form data from frame to other frame audio-catalyst Classic ASP Basics 5 January 3rd, 2006 02:57 PM
Call right frame Page_Load event from left frame. ochanarachel Classic ASP Basics 0 January 28th, 2005 05:13 AM
Refresh a frame from another frame czambran Javascript 3 October 21st, 2004 11:20 AM



All times are GMT -4. The time now is 04:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.