Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.GoToPage problem

Status
Not open for further replies.

joel009

Programmer
Jul 7, 2000
272
US
I have a form with 2 pages. In the second form is a list box that won't scroll unless the 2nd page has the focus. I have tried using the DoCmd.GoToPage 2 but keep getting the error "runtime error 2046, the action or command 'GoToPage' isn't available now". I have tried putting in the location reference, DoCmd.GoToPage 2, 0, 4.7917, with no change.
I am putting this in the gotfocus event of the listbox. Only the listbox gives me a problem, combo boxes, check boxes, date formated fields work fine. The list box only works with a page change to the page it's on. I can even tab through the whole first form and get to the 2nd page and then the listbox works.
Do i have to reference the pages break by name explicitly? I have tried this a few ways but without any luck.
Any ideas?
 
?
If you are clicking into a listbox on the second page then the listbox must by definition get the focus. So The message you get sounds quite correct since you must already be on page 2 and so cannot go there.
 
You indicate
" I have a form with 2 pages. In the second form ..."

I am not exactly sure what you mean. Do you have one form that is long and broken into two parts or do you have 2 separate forms??

You may want to consider using a tabbed form.


HTH

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description - FAQ702-5106
 
Ok, that makes sense about already being in page 2 - duh. I have one long form, not really that long. some users want to use a button that calls a macro to switch forms and others want to be able to scroll to the bottom or 2nd form. Setting up tabs wouldn't satisfy those who want to scroll. The only thing that doesn't work is the scroll on the list box, unless of course they use the button to switch forms.
So I have 2 solutions (if I can figure them out). 1 - to make the list box work all the time or 2 - switch to form 2 as the click into the list box. Or anything else someone can suggest????
Thanx
Joel
 
I have one long form, not really that long. some users want to use a button that calls a macro to switch forms and others want to be able to scroll to the bottom or 2nd form.
Not sure how not that long really is! Since you have users that want something different, you may just have to decide for them.
One other thing you might try is making the font and point sizes smaller of all your objects thus trying to fit everything onto one page.

Good Luck!!

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description - FAQ702-5106
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top