Using a combo box to populate and display the rest of selected rec

C

CollegeKingKid

I have a drop down box that lets a user select IDs of the records. After they
choose the one they want I want the rest of the information (such as name,
address, etc.) to be populated for them. Any suggestions would be great!
 
A

AccessNubee

Assuming the combo box is on the same form...
and you are using either a table or a query as your record source.
I use this code which was origionally written by Helen Feddema.
(www.helenfeddema.com)

Put the following code (between the lines) behind the "AfterUpdate" event:
-------------------------------------------
Private Sub cboSelect_AfterUpdate()
'Written by Helen Feddema 6/30/2000
'Last modified 6/30/2000

On Error GoTo ErrorHandler

Dim strSearch As String

strSearch = "[CID] = " & Me![cboSelect]
'Find the record that matches the control
Me.RecordsetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark
ErrorHandlerExit:
Exit Sub
ErrorHandler:
MsgBox "Error No: " & Err.Number & "; Description: " & _
Err.Description
Resume ErrorHandlerExit
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

Top