ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I set the focus to a page in a multipage (https://www.excelbanter.com/excel-programming/317618-how-do-i-set-focus-page-multipage.html)

Azza

How do I set the focus to a page in a multipage
 
I am checking that values have been added to pages in a multipage and
need to set the focus to the tab before i set the focus to the
textbox.

Currently it errors as the page is not in focus....

Here is the code:

'Checks if ADDRESS - LINE 1 is entered
If Me.tbResAddressLineOne = "" Then
MsgBox "Please complete the mandatory 'Address' fields",
vbInformation, mboxheader
'***CODE IN HERE TO FOCUS ON THE MULTIPAGE PAGE BEFORE TRYING TO FOCUS
ON THE BOX***
Me.tbResAddressLineOne.SetFocus
Exit Sub

Help appreciated

Cheers
aaron

Pierre Archambault

How do I set the focus to a page in a multipage
 
Try :

Multipage1.Value = 0 '(Page 0 for first page, 1 for second... )

Before the line :
Me.tbResAddressLineOne.SetFocus

Pierre


"Azza" a écrit dans le message de
m...
I am checking that values have been added to pages in a multipage and
need to set the focus to the tab before i set the focus to the
textbox.

Currently it errors as the page is not in focus....

Here is the code:

'Checks if ADDRESS - LINE 1 is entered
If Me.tbResAddressLineOne = "" Then
MsgBox "Please complete the mandatory 'Address' fields",
vbInformation, mboxheader
'***CODE IN HERE TO FOCUS ON THE MULTIPAGE PAGE BEFORE TRYING TO FOCUS
ON THE BOX***
Me.tbResAddressLineOne.SetFocus
Exit Sub

Help appreciated

Cheers
aaron




Aaron Macdonald

How do I set the focus to a page in a multipage
 
Thank you very much

Aaron



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 04:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com