Update Unbound List Box from Form

P

Peter Noneley

Hello,

I have Form with a Unbound List box that I use to find records on the
same Form.

It works great.

[My Question]
When I move through records on the actaul Form, (such as with PageUp /
PageDown), how do I get the List to highlight the same record?

[What I Tried]
I tried tinkering with the Bookmarks, but could not see what to do.
I tried Refreshing the List, but that does not do it.
I tried looking at an On Key Press event on the Form.
I think I am in the right area, I just cant see how to put it
together.

Thanks for even the briefest of help.

Thanks.

[This is is List code.]
Private Sub List26_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[PersonID] = " & Str(Nz(Me![List26], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
 
P

Peter Noneley

Hi peter:

try in the Oncurrent event of the form

me.List26= me.PersonID

--
Kind regards
Noëlla



Peter Noneley said:
I have Form with a Unbound List box that I use to find records on the
same Form.
It works great.
[My Question]
When I move through records on the actaul Form, (such as with PageUp /
PageDown), how do I get the List to highlight the same record?
[What I Tried]
I tried tinkering with the Bookmarks, but could not see what to do.
I tried Refreshing the List, but that does not do it.
I tried looking at an On Key Press event on the Form.
I think I am in the right area, I just cant see how to put it
together.
Thanks for even the briefest of help.

[This is is List code.]
Private Sub List26_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[PersonID] = " & Str(Nz(Me![List26], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub- Hide quoted text -

- Show quoted text -

Me.Happy=Noella.Thankyou !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top