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

Implementing a subform based on a passthru query 1

Status
Not open for further replies.

Xzibit7

Technical User
Jun 20, 2006
172
US
I am trying to create multiple subforms in a form that are grouped by a part number, based on multiple passthru queries. I know that ACCESS does not allow you to do this with the parent child realationship of subforms, but I am trying to figure out how to accomplish this via code. I found this snippet of code written by datAdrenaline on the utter access forums but cant seem to get it to work

Private Sub Form_Current()

If Not Me.NewRecord Then
CurrentDb.QueryDefs("<name of your passthru>").SQL = "SELECT * FROM <table owner>.<table name>" & _
" WHERE <link child field name> = " & Me.<name of master field/control>
With Me.<name of sub from control>.Form
.RecordSource = .RecordSource ' .. or the name of your passthru
End With
End If


Does anyone know if this goes in a module or somewhere in the form or subforms event procedure?
 
From what I can see, the snippet seems intended to run in the main form's Current event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top