?
Solved

Multipage Control

Posted on 2003-03-08
4
Medium Priority
?
167 Views
Last Modified: 2013-12-25
Yet another difficult one - researched all manner of books and net without success!
I have a Multipage object of three pages.  I want to control which Multipage is visible/selected/top-most when I execute the setfocus on a text box in that page - otherwise it generates an error.

Two of us have tried to solve this - one very experienced VB/Access programmer and me, the novice.
There is no guarantee that the necessary Multipage.page will be open on entering the form - I can test for that.  The problem is leaving the form, if the data causes an error (which I check for) I need to force the user to the approrpiate multi.page(i) and setfocus to the textbox!!

Easy - should be written somewhere one would think?
0
Comment
Question by:drummerboy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 5

Accepted Solution

by:
JohnMcCann earned 200 total points
ID: 8097738
Have you tried

Private Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long

During the datavalidation if the Validation fails use PutFocus Text1.hWnd
0
 
LVL 5

Expert Comment

by:JohnMcCann
ID: 8097755
You may need to PutFocus on the form first if it has lost it.  
0
 
LVL 5

Expert Comment

by:JohnMcCann
ID: 8097771
So in order

PutFocus Form1.hWnd  'Set focus to from
MultiPage1.Value = 0 'Set visible page to index 0
PutFocus Text1.hWnd
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9053196
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept JohnMcCann's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question