Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > BOOK: Excel VBA 24-Hour Trainer
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Excel VBA 24-Hour Trainer
This is the forum to discuss the Wrox book Excel VBA 24-Hour Trainer by Tom Urtis; ISBN: 978-0-470-89069-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel VBA 24-Hour Trainer 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 Display Modes
  #1 (permalink)  
Old April 25th, 2013, 10:54 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multipage in Userform

I've found the book very useful but I'm now trying (and failing) to do something not detailed in the book. If anyone can help I'd be grateful. This is the code I've written which runs when the user clicks a new page tab in a multipage in an Excel Userform:
[code]
Private Sub MultiPage1_Change()
'If a page has been changed, ensure previous page is complete
ok = True
Static ppindx
If MultiPage1.Value < 0 Then 'No pages active - do nothing
Exit Sub
ElseIf IsEmpty(ppindx) Then 'first time call to this procedure
ppindx = MultiPage1.Value
ElseIf ppindx <> MultiPage1.Value Then 'new page selected
For Each tb In MultiPage1.Pages(ppindx).Controls
If tb.Name Like "TextBox*" Then
If tb.Text = "" Then
MsgBox ("Must complete all information on current page.")
MultiPage1.Value = ppindx
tb.SetFocus
tb.SelStart = 0
tb.SelLength = Len(tb.Text)
ok = False
Exit For
End If
End If
Next tb
End If
If ok = True Then
ppindx = MultiPage1.Value
End If
End Sub
[\code]
What I'm trying to do is check whether the original page had been fully completed - textboxes filled in etc - before allowing the user to open the next page. If the original page was NOT completed I want to redisplay it and set the focus to the empty textbox. The above code fails when try to do that and if I step through the code one line at a time it seems to select the original page tab OK but not bring that page to the front. Subsequently, when I try to set the focus to the unfilled textbox it isn't visible and an error occurs.
I'm only a hobbyist as far as programming goes so my knowledge is pretty limited and I'd appreciate being pointed in the right direction here as I've played around with it for a long time now and haven't found a solution.
Thanks
Reply With Quote
Reply


Thread Tools
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
VBA Multipage Suhaskurse Access VBA 2 June 1st, 2011 01:57 PM
multipage activate Fat_and_immoral Excel VBA 5 March 7th, 2007 01:03 PM
PHP Multipage to look like one Lofa PHP How-To 2 September 5th, 2006 12:52 PM
use of multipage MANOJMETAL VS.NET 2002/2003 0 April 17th, 2004 01:29 AM
Multipage Menu LHaines Classic ASP Basics 1 June 3rd, 2003 07:05 PM



All times are GMT -4. The time now is 10:47 AM.


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