Continuous subform partly scrolls to the right on load / requery (AC2013) (1 Viewer)

AOB

Registered User.
Local time
Today, 08:56
Joined
Sep 26, 2012
Messages
615
Hi there,

I have a continuous subform residing inside a parent form.

I recently added two columns to the subform and now for some reason every time I load the parent form, the subform is always partly scrolled, horizontally, to the right, by a couple of centimetres.

I thought it may have been due to my new textbox controls being positioned incorrectly in the tab order of the subform but they are in the correct order. Also, the scroll doesn't appear to align with any particular control on the subform.

I have to scroll back to the left every time, but then if I perform any requeries, it scrolls to the right again.

Really frustrating and I can't figure out what exactly I've done to cause this to happen but I need to fix it as it looks awful. It always loaded "to the top-left" before so I can't figure out what's changed?

Also tried deleting the subform from the main form and adding it back again to see if that fixed it but it hasn't - so it must be an issue with the subform itself?

Any ideas?

Thanks!

AOB
 

Ranman256

Well-known member
Local time
Today, 03:56
Joined
Apr 9, 2015
Messages
4,339
in the subform:
make sure the 1st box selected it on the far left. (tabIndex=0)
make sure the width of the subform is tight with no extra room on the right
you can set the horizontal scroll bar off.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 08:56
Joined
Feb 19, 2013
Messages
16,601
does your subform have any code to set the focus to a particular control? or code to 'go to last record' or similar.

Also check the tab order for your controls
 

AOB

Registered User.
Local time
Today, 08:56
Joined
Sep 26, 2012
Messages
615
Thanks guys,

Looks like it was tab ordering

I have a command button as the leftmost control of each record (to allow a quick delete) but had it at the bottom of the tab order as I didn't want it to take the focus on loading (lest anybody accidentally hit the Enter key - even though it prompts for confirmation first anyway)

The textbox controls are all disabled (they're just for display, not for editing) and then I had a handful of toggle buttons at the rightmost end.

I must have had the subform sized in such a way that the first toggle button was taking the focus on load, but the object was wide enough that it didn't automatically scroll horizontally. When I added more textboxes, that was no longer the case.

So I just moved the command button to the top of the tab order and now it always displays at the left-most column.

Bit of a brain fart, sorry... :eek:
 

Users who are viewing this thread

Top Bottom