D
Dennis
I'm trying to have two listboxes scroll each other with
the following code:
Private Sub List1_Scroll()
List2.TopIndex = List1.TopIndex
End Sub
Private Sub List2_Scroll()
List1.TopIndex = List2.TopIndex
End Sub
This is great for VB, but VBA doesn't offer a Scroll Event
for a listbox. The scrollbars that automatically appear
on Access listboxes don't seem to fire any events
(BeforeUpdate, AfterUpdate, etc.).
I'm trying to NOT use a bulky ActiveX control to sync two
listboxes (if possible) and am not sure if creating some
kind of class using the WithEvents keyword is the way to
go. Is there a way to access a native Access control
event for this purpose?
FYI - The top listbox will just show the Column Heads and
the botton listbox will show the records WITHOUT the
Column Heads. I'm doing this because the bottom listbox's
RowSource is set to an SQL string and if the ColumnHeads
property is not set to False when setting the
RowSource, the field headings become the first row in the
listbox causing .Column(0, 0) to become "Column_Name"
instead of the actual Column value. This throws off the
index by 1, creating a subtle error
I appreciate any and all help - Thanks !!!
the following code:
Private Sub List1_Scroll()
List2.TopIndex = List1.TopIndex
End Sub
Private Sub List2_Scroll()
List1.TopIndex = List2.TopIndex
End Sub
This is great for VB, but VBA doesn't offer a Scroll Event
for a listbox. The scrollbars that automatically appear
on Access listboxes don't seem to fire any events
(BeforeUpdate, AfterUpdate, etc.).
I'm trying to NOT use a bulky ActiveX control to sync two
listboxes (if possible) and am not sure if creating some
kind of class using the WithEvents keyword is the way to
go. Is there a way to access a native Access control
event for this purpose?
FYI - The top listbox will just show the Column Heads and
the botton listbox will show the records WITHOUT the
Column Heads. I'm doing this because the bottom listbox's
RowSource is set to an SQL string and if the ColumnHeads
property is not set to False when setting the
RowSource, the field headings become the first row in the
listbox causing .Column(0, 0) to become "Column_Name"
instead of the actual Column value. This throws off the
index by 1, creating a subtle error
I appreciate any and all help - Thanks !!!