I have a lookup combo box in a main form with the following VBA AfterUpdate:
'Clone the form's table/query into a recordset.
Dim MyRecSet As Object
Set MyRecSet = Me.Recordset.Clone
'Find first matching record in the recordset.
MyRecSet.FindFirst "[CasePlanID] = " & Me![Lookup]
'Set the form's record to found record.
Me.Bookmark = MyRecSet.Bookmark
I need the data selected in this lookup combo box to populate fields on the main form (where the lookup combo is) and in several subforms. This was working perfectly until I added a new record. Now, it still works perfectly for all existing records but when I select the newly added record, the form and subforms populate with data for the very first record ever entered instead of the new one. Anyone have any suggestions or run into this before? I have been troubleshooting all day and am all out of ideas. Any help is greatly appreciated!
'Clone the form's table/query into a recordset.
Dim MyRecSet As Object
Set MyRecSet = Me.Recordset.Clone
'Find first matching record in the recordset.
MyRecSet.FindFirst "[CasePlanID] = " & Me![Lookup]
'Set the form's record to found record.
Me.Bookmark = MyRecSet.Bookmark
I need the data selected in this lookup combo box to populate fields on the main form (where the lookup combo is) and in several subforms. This was working perfectly until I added a new record. Now, it still works perfectly for all existing records but when I select the newly added record, the form and subforms populate with data for the very first record ever entered instead of the new one. Anyone have any suggestions or run into this before? I have been troubleshooting all day and am all out of ideas. Any help is greatly appreciated!