Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repopulate form based on search combo box 2

Status
Not open for further replies.

jsdavis

MIS
Apr 4, 2007
8
US
I have a combo box in a search form that I want to use to repopulate a form with. I pull up records that match a certain criteria into a combo box. I want to be able to click on a certain record listing from the combo box and have that record information populate a form. Here is the basic code that I have so far:

Private Sub cmbSearchResults_AfterUpdate()
'Update file information on File form based on SearchResults combo box.

Form_Files.RecordSource = Me.cmbSearchResults.RowSource

DoCmd.Close acForm, "SCITSearch"


End Sub

The problem is-the other form updates but only once and with just the first record that shows up at the top of the combo box each time I do a search rather than with whatever record I click on. Thank you for any help that can be given. :)
 
Maybe you could use something like this:

Code:
Private Sub Combo0_AfterUpdate()
    Forms("frmYourForm").Filter = "YourID =" & Me.Combo0
    Forms("frmYourForm").FilterOn = True
End Sub

Pampers [afro]
Keeping it simple can be complicated
 
Pampers,

You are brilliant! :) It's so simple and it works great! Thank you so much!

God Bless-
jsdavis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top