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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating a subform based on the value from a list box help.

Status
Not open for further replies.

Xenos132

Technical User
Dec 12, 2004
43
CA
I have a form that I am populating with

Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CustomerID] = " & Str(Me![List1])
Me.Bookmark = rs.Bookmark


On this form I would like to populate a subform based on the value from [List2]

Being a novice I would think this could work however I don’t understand enough to do it.

Dim ss As Object

Set ss = subform.Recordset.Clone
ss.FindFirst "[Location ID] = " & Str(Me![List2])
subform.Bookmark = ss.Bookmark

Am I looking in the right area? And can you lend some code?

 
The problem people have with subforms is that there are two different things: the subform control, and the form within the subform control. To reference the form you must do something like:

Me.subFormControlName.form

so

dim rsSS as dao.recordset
set rsSS = me.subFormControl.form.recordsetclone
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top