L
Lee
Hi everyone,
I really hope you can help as I'm tearing (what's left of
my) hair out!!!
A form has a listbox (called lstCentres) which gets its
data from a separate (query) source to the main form -
it's not bound to the forms data.
The list contains lots of records so I want to be able to
allow the user to 'jump' to a specific record rather than
scroll endlessly....simple eh?
I just can't get this to work though and I don't know why.
Here's the code:
Dim rs As DAO.Recordset
Dim varCentre As Variant
varCentre = InputBox(blah blah...)
Set rs = Me.RecordsetClone
rs.FindFirst "lstCentres=" & varCentre
If rs.NoMatch Then
msgbox(blah blah)
Else
Me.Bookmark = rs.Bookmark
End If
The bound column of the listbox is 'CentreNo' which is a
five-digit LongInteger and is the number that will be put
in the input box.
When I try this out I'm told 'lstCentres' isn't
recognised/valid.
Any ideas would be really appreciated.
Please spell it out to me as I've lost the plot!
Many thanks,
Lee
I really hope you can help as I'm tearing (what's left of
my) hair out!!!
A form has a listbox (called lstCentres) which gets its
data from a separate (query) source to the main form -
it's not bound to the forms data.
The list contains lots of records so I want to be able to
allow the user to 'jump' to a specific record rather than
scroll endlessly....simple eh?
I just can't get this to work though and I don't know why.
Here's the code:
Dim rs As DAO.Recordset
Dim varCentre As Variant
varCentre = InputBox(blah blah...)
Set rs = Me.RecordsetClone
rs.FindFirst "lstCentres=" & varCentre
If rs.NoMatch Then
msgbox(blah blah)
Else
Me.Bookmark = rs.Bookmark
End If
The bound column of the listbox is 'CentreNo' which is a
five-digit LongInteger and is the number that will be put
in the input box.
When I try this out I'm told 'lstCentres' isn't
recognised/valid.
Any ideas would be really appreciated.
Please spell it out to me as I've lost the plot!
Many thanks,
Lee