Open anotherform based on combo box selection & load data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that is built on a query and displays records based on query
results. Also have put a combo box which loads the list of the records and
the user can choose a record that he would like to see details of, following
is the code:

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

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

Now I would like to open another form called “F_lookup†and then load the
selected record select above to automatically load the record details in this
new form.

Could someone help, thanks.
 
Not sure why you want to open another form to view the records, look at this
link on "Using a Microsoft Access Combo Box to Search for a Record"

http://www.databasedev.co.uk/combo_box_search.html

For future reference, to open another form and display filtered by a combo
selection, you can use the WhereCondition of the OpneForm command line

Dim MyCondition
MyCondition = "[Type_ID] = " & Nz(Me![Combo18], 0)
Docmd.OpenForm "FormName", , ,MyCondition
 

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

Back
Top