PDA

View Full Version : Change Pages



mud2
11-09-2006, 08:29 PM
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

mud2
11-09-2006, 09:00 PM
Guess because I'm stubborn! I want a control button on Page1 that when clicked will take me to page2.

mud2
11-09-2006, 09:01 PM
Guess because I'm stubborn! I want a control button on Page1 that when clicked will take me to page2.

mud2
11-09-2006, 09:06 PM
To Saaurabhk:

As suggested by Access help:
Sub Command11_Click() ( something like this)
DoCmd.GoToPage 2
End Sub

OBP
11-10-2006, 04:21 AM
mud2, I don't use pages, but do you need to include the Mainform name or me. in the docmd command?

mud2
11-10-2006, 07:51 AM
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?

OBP
11-10-2006, 07:57 AM
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?

mud2
11-10-2006, 04:06 PM
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!