J
Jeff Hunt
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?
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?