ComboBox Form Lookup

J

John

I have a from with a combobox that looks up a value on my form. The code is
directly from the Access Wizard.

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[PatID] = " & Str(Nz(Me![List22], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I would like to be able to use the Navigation Buttons on the bottom of the
form, and have the corresponding record in the combo box also highlight
(basically doing the reverse of the code above).

I am doing this just so the user will not become confused as to where they
are.

Thanks
 
T

tina

assuming that the combo box control is unbound, try the following code in
the form's Current event, as

With Me
If Not IsNull(.PatID) Then
.List22 = .PatID
End If
End With

hth
 

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