djeverett01
Programmer
Ok. I have looked almost all day for a solution to this question on this boards, but I can't seem to find it so I am begging now for help from the Experts.
I have a form with a continuous subform. What I want to do is automatically fill in the subform based on the current record the main form is on.
A little more detail. I have a group of people and they each have a set of goals based on their ID. I want to autofill the subform with all of the goals a person may have.
I am using this code to do this:
Private Sub Form_Current()
Dim Info As DAO.Recordset, SQLText
SQLText = "SELECT * FROM [qryGoals] WHERE [ID] = '" & Me![ID] & "'"
Set Info = CurrentDb.OpenRecordset(SQLText)
Me![Goal] = Info![Goal]
End Sub
This works great except for the fact that I hae some records with more than one goal so If teh person has 2 goals I want to fill in the subform with both goals. Is this possible?
Dawn Nelson Everett
I have a form with a continuous subform. What I want to do is automatically fill in the subform based on the current record the main form is on.
A little more detail. I have a group of people and they each have a set of goals based on their ID. I want to autofill the subform with all of the goals a person may have.
I am using this code to do this:
Private Sub Form_Current()
Dim Info As DAO.Recordset, SQLText
SQLText = "SELECT * FROM [qryGoals] WHERE [ID] = '" & Me![ID] & "'"
Set Info = CurrentDb.OpenRecordset(SQLText)
Me![Goal] = Info![Goal]
End Sub
This works great except for the fact that I hae some records with more than one goal so If teh person has 2 goals I want to fill in the subform with both goals. Is this possible?
Dawn Nelson Everett