Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Synchronize subform scrolling

Geek News

Synchronize subform scrolling
Jeff Hunt 11/26/2008 6:58:19 PM
I have a continuous subform that has many fields on it, so you have to scroll
horizontally to view all the data. I would like to "anchor" two key fields
(account numbers) on the left side, to produce an effect like "freeze panes"
in Excel (or like having a "form header" on the left side of the screen
instead of the top). My thought to solve this was to have two different
subforms based on the same data, with the left one showing only the account
numbers, and the right one containing everything but the acct numbers. The
problem with this is when there are more records than fit vertically in the
subform, the left and right forms get out of sync when you scroll one form.
While researching this, I found the following code in the forum:

Private Sub Form_Current()

Dim rs As DAO.Recordset

If (Not IsNull(Me![ID])) And _
(Not IsNull(Parent.OtherSubFormControl.Form![ID])) And _
(Me![ID] <> Parent.OtherSubFormControl.Form![ID]) Then
Set rs = Parent.OtherSubFormControl.Form.RecordsetClone
rs.FindFirst "ID = " & Me![ID]
If Not rs.NoMatch Then
Parent.OtherSubFormControl.Form.Bookmark = rs.Bookmark
End If
End If

End Sub

However, this only seems to make sure that both matching records are visible
in each form, and only if I click on one. It does not actually synchronize
the scrolling with the scroll wheel or scroll bars, and in a large subform
the lines are frequently out of alignment between the forms. Is such
scroll-linking possible? If not, is there some way to get the "freeze panes"
look I want on my subform?

--
....jeff...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Re: Synchronize subform scrolling
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 11/27/2008 4:46:43 AM
On Wed, 26 Nov 2008 10:58:19 -0800, Jeff Hunt
<JeffHunt[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>I have a continuous subform that has many fields on it, so you have to scroll
>horizontally to view all the data.

Ummm... any reason not to use a continuous form with two or three rows of
controls?
--

John W. Vinson [MVP]
Re: Synchronize subform scrolling
Marshall Barton <marshbarton[ at ]wowway.com> 11/27/2008 5:18:53 AM
Jeff Hunt wrote:

[Quoted Text]
>I have a continuous subform that has many fields on it, so you have to scroll
>horizontally to view all the data. I would like to "anchor" two key fields
>(account numbers) on the left side, to produce an effect like "freeze panes"
>in Excel (or like having a "form header" on the left side of the screen
>instead of the top). My thought to solve this was to have two different
>subforms based on the same data, with the left one showing only the account
>numbers, and the right one containing everything but the acct numbers. The
>problem with this is when there are more records than fit vertically in the
>subform, the left and right forms get out of sync when you scroll one form.


See if this can do what you want:
http://www.lebans.com/setgetsb.htm

--
Marsh
MVP [MS Access]
Re: Synchronize subform scrolling
Jeff Hunt 12/1/2008 3:04:10 PM
Mostly preference. With multiple rows, the column labels in the subform
header would not line up, or there would have to be multiple rows there as
well. Basically I think it would look cluttered, and since several fields
have similar data in them, it could be confusing to the user. Thanks for the
suggestion though.
--
....jeff...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


"John W. Vinson" wrote:

[Quoted Text]
> On Wed, 26 Nov 2008 10:58:19 -0800, Jeff Hunt
> <JeffHunt[ at ]discussions.microsoft.com> wrote:
>
> >I have a continuous subform that has many fields on it, so you have to scroll
> >horizontally to view all the data.
>
> Ummm... any reason not to use a continuous form with two or three rows of
> controls?
> --
>
> John W. Vinson [MVP]
>
Re: Synchronize subform scrolling
Jeff Hunt 12/1/2008 3:07:02 PM
That looks like it could work. Now I just need to figure out HOW it works
enough to add it into my existing forms. I'll reply back again if I'm stuck
and still want to try this. I'm still open to any other suggestions out
there as well.
--
....jeff...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


"Marshall Barton" wrote:

[Quoted Text]
> Jeff Hunt wrote:
>
> >I have a continuous subform that has many fields on it, so you have to scroll
> >horizontally to view all the data. I would like to "anchor" two key fields
> >(account numbers) on the left side, to produce an effect like "freeze panes"
> >in Excel (or like having a "form header" on the left side of the screen
> >instead of the top). My thought to solve this was to have two different
> >subforms based on the same data, with the left one showing only the account
> >numbers, and the right one containing everything but the acct numbers. The
> >problem with this is when there are more records than fit vertically in the
> >subform, the left and right forms get out of sync when you scroll one form.
>
>
> See if this can do what you want:
> http://www.lebans.com/setgetsb.htm
>
> --
> Marsh
> MVP [MS Access]
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net