J
Jason
I'm working on a project where I have several ListBoxes on
a Form and I'm setting a Control object to each of them so
I can pass the ListBoxes to a function.
Example:
Dim ctlSource As Control
Set ctlSource = lstBox1
The problem is I want to transverse the data in the ListBox
to see what values are selected by the user via a FOR loop.
The following code works fine on my system at home, but
doesn't when I transport the Access file (.mdb) to the
person's computer who will actually be using the application:
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
'Run Some Code Here
End If
Next intCurrentRow
It reports an error message of "object doesn't support this
property or method" or something similar, and gets hung up
on the .ListCount portion of the code. I can understand
why it doesn't think it should work, since technically a
control object doesn't have a ListCount property or method,
but if it works fine on my system at home, what could be
the hang up on a different one? We're both using Access
2002. Any help you can offer would be greatly appreciated.
Thanks!
a Form and I'm setting a Control object to each of them so
I can pass the ListBoxes to a function.
Example:
Dim ctlSource As Control
Set ctlSource = lstBox1
The problem is I want to transverse the data in the ListBox
to see what values are selected by the user via a FOR loop.
The following code works fine on my system at home, but
doesn't when I transport the Access file (.mdb) to the
person's computer who will actually be using the application:
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
'Run Some Code Here
End If
Next intCurrentRow
It reports an error message of "object doesn't support this
property or method" or something similar, and gets hung up
on the .ListCount portion of the code. I can understand
why it doesn't think it should work, since technically a
control object doesn't have a ListCount property or method,
but if it works fine on my system at home, what could be
the hang up on a different one? We're both using Access
2002. Any help you can offer would be greatly appreciated.
Thanks!