Scrolling with code (1 Viewer)

robertbwainwright

Registered User.
Local time
Today, 10:03
Joined
May 2, 2012
Messages
62
I have a form (frmCommoditySupplierSpend)and a subform (frmCommoditySupplierSpendSubForm1ByVend). I have a control button in the main form that will scroll down the page of the main form to a point I desire by using:

Forms![frmCommoditySupplierSpend].GoToPage 1, 0, 9250

The problem that I am having is in my subform I have a button as well and when a user clicks the button in the subform I want the main form to scroll down to the same point. I thought the same exact code should work, but it ends up scrolling down the subform instead of the mainform, even though the main form is being stated. I'm sure there is a way to do this, and maybe I'm not even using the correct command. Any help on how to scroll down my main form when using a contol in subform would be appericaited.

thanks,
Robert
 

robertbwainwright

Registered User.
Local time
Today, 10:03
Joined
May 2, 2012
Messages
62
I solved this on my own in case someone has interest. I ended up having to set the focus to an object in my main form before having the GoToPage method happen. I think the form was confused because a button in the subform had the focus.
 
Last edited:

Mihail

Registered User.
Local time
Today, 18:03
Joined
Jan 22, 2011
Messages
2,373
I experimented something similar today when I tried to go to the new record in subform from the main form.
First is need to move the focus to the subform control.
Else, the command act on the main form anyway.
 

Users who are viewing this thread

Top Bottom