Another ComboBox ?

M

Mike J

I have a comboBox with a query for the Row Source, bound
to column 1(Last Name). Is there any way to findrecord on
two columns. In other words I want to pick the entry in
the list and find the record based on column 1 and 4(ID).
 
B

Bill Taylor

Yes. reference the columns by combobox.column(0) and combobox.column(3) ( a
zero based system). Use these variables in your findnext statement. Use the
after update event of the comtrol like so:
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[LastName] = " & Str(Nz(Me![ComboBoxName].Column(0), 0)) &
" AND [ID] = " _
& Str(Nz(Me![ComboBoxName].Column(3) , 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
 

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