|
I am developing in Access 2003. I have a form that has a record set associated to it. It allows you to edit one record at a time through text boxes for each field. To this form I added a list box (lstInstruments) from a query of the same table that the form is linked to.
In the AfterUpdate event of the list box I entered the following code.
Set rs = Me.Recordset.Clone rs.FindFirst "[InstrumentID] = " & Str(Me![lstInstruments]) Me.Bookmark = rs.Bookmark
This allows me to have a list of all of the records on the form, select one in the list box and then the detail part of the form updates to the correct record.
Now I need to do the reverse. When I click on the record navigator buttons and move from record to record, I need to have the the ListIndex of the list box updated so that the proper record is highlighted in the list box. Is there a way to search the items in the list box to find the item where the the first column = [InstrumentsID] or do I have to go create a recordset of the same query that sources the list box a walk through those records one at a time with a counter to "calculate" the index number. |