Refreshing Form Data that is Linked to a List Box

R

Ryan

I am using a list box on a form that gets updated with data from a pop-up
form that I created. The information added to the list box is the primary
key for the data listed on the form. I can add the data to the list box, but
when I highlight the newly added number the fields on the form display the
data for the first record in the table. Is there VB code that can be added
to the AfterUpdate event procedure of the list box that would refresh the
table data? Below is what is currently in the AfterUpdate event procedure.

Private Sub List2_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[FrmNumber] = '" & Me![List2] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
 

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