View Full Version : Change Pages
I have a form with several pages. How do I change from one page to another? When I use "DoCmd.GoToPage x" , (x = 1 2 ...) I get an error message saying there isn't any such page.
Saurabhk
11-09-2006, 08:46 PM
Hi mud2,
I don't think I totally understand your question. Why don't you use normal navigation buttons at the bottom of the report?
Saurabhk
11-09-2006, 08:58 PM
sorry my mistake.
Would you be able to provide a screen dump or some coding of your form
Guess because I'm stubborn! I want a control button on Page1 that when clicked will take me to page2.
Guess because I'm stubborn! I want a control button on Page1 that when clicked will take me to page2.
To Saaurabhk:
As suggested by Access help:
Sub Command11_Click() ( something like this)
DoCmd.GoToPage 2
End Sub
mud2, I don't use pages, but do you need to include the Mainform name or me. in the docmd command?
Your suggestion started me. "Me" works, but even simpler:
"Pagex.setfocus" works!
You can place this command on a page, or on the form underlying the pages!
So why doesn't ACCESS help tell us?
mud2, like all Microsoft Helps, the Access one is very very hard work, unless you know what to ask for and how can you know what to ask for when the help is so poor. That is one of the reasons I like Good reference Books.
I assume the "x" in "Pagex.setfocus" is the page number?
Where did you manage to find it?
Yes, the "x" in Pagex is the page number (or name, if you name a page). Where did I find it? The earlier suggestion of using "me" had me type in "me", which was immediately followed by access's drop down list of objects applied to "me" I saw "me.page1 and me.page2 (I had two pages IO was playing with.)", and that led me to try me.pagex. which gave drop downs including SetFocus. Then I found that the "me" wasn't necessary. Why use this instead of simply clicking on a page tab?...I (will) use it to go to a page dependng on the data in a different page.
Ah, the "hit" and "miss" method!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.