I have a strange issue.
My main form is bound to a single table. I wanted to be able to navigate records on the main form by picking a record from an unbound ListBox on the form. I've done this many times, and use the ListBox wizard to setup that ListBox.
This time a ListBox doesn't suit my needs, because I want more control over the list records, such as different fonts for different columns, and some conditional formatting in the list fields. Therefore I created a subform bound to the same table. In the subform's On_Current event, I run a public Subroutine on the Parent form, sending it the record ID from the subform. This subroutine tells the Parent form to find that record.
This is working perfectly, except for a strange quirk:
When the forms all load, the first record of the subform is selected by default. The On_Current event fires properly (I have the following code in the On_Current event to verify):
Code:
Debug.Print "form_current, order=" & Me.OrderID
The very first time I click on another subform record, nothing happens. The first record is still current, and no On_Current event fires (of course).
The next time I click on another subform record (and every time after that), that record gets focus and the On_Current event fires properly.
Maybe pertinent: If I close the main form and open the subform by itself, this doesn't happen. It only happens if the form is actually being used as a subform.
Any idea what's not working here? Thanks...