ComboBox out of synch with form

D

Dkline

I have a form with a combobox. The user selects the "Producer Name" from
this combobox and they see the information for the selected record.
"NumPolicies" is the last control in the tab order on the form.

My problem is if they tab through all the fields on the main form, the
recordset advances but the combox does not. It retains what the user had
selected even though the recordset has moved on to the next record.

On exit from the last control on the form I'm trying to synchronize them
back to what is in the combobox. Alternatively if I can change the value in
the combox to match the now current record, that's OK too. Just want them to
agree on which record are we looking at now.

Below is my code to try and rectify the problem :

Private Sub NumPolicies_Exit(Cancel As Integer)
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Producer Name] = '" & Me![Combo24] & "'"
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

Similar Threads

Combo Box Updates, but Form/Data Doesn't 13
OnLoad event criteria 7
Textbox Filter 4
Combobox trouble 1
RunTime Error 3070 11
combobox, NotInList, update form 5
Error 2147352567 2
Copy Record Button Function 1

Top