G
Guest
I have a main form containing a button to do a search. Clicking this gives a
popup of available records. Selecting one will then populate the main form
(and close the search popup). On the main form also is a subform which
contains correspondence. The subform is set up as a continuous form and what
i am trying to do is populate it. The main form has an ID number and it
should show all records in the continuous form with the same id (ie
correspondance relating to that record) I am trying to do it with the
following code but it shows me only one record (the last one). I want it to
behave like a regular continuous form listing one after the other.... any
ideas? or impossible using this method?
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT tblAction.ActionIDS,
tblAction.ContactID, tblAction.ActionDate, tblAction.ActionNotes FROM
tblAction WHERE tblAction.ContactID = " & Forms!frmContact!txtSetSchID & ";")
With rs
If .RecordCount > 0 Then
Do Until .EOF
Forms!frmContact!fsubContactAction.Form.txtActionDate = !ActionDate
.MoveNext
Loop
End If
.Close
End With
rs.Close
Set rs = Nothing
popup of available records. Selecting one will then populate the main form
(and close the search popup). On the main form also is a subform which
contains correspondence. The subform is set up as a continuous form and what
i am trying to do is populate it. The main form has an ID number and it
should show all records in the continuous form with the same id (ie
correspondance relating to that record) I am trying to do it with the
following code but it shows me only one record (the last one). I want it to
behave like a regular continuous form listing one after the other.... any
ideas? or impossible using this method?
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT tblAction.ActionIDS,
tblAction.ContactID, tblAction.ActionDate, tblAction.ActionNotes FROM
tblAction WHERE tblAction.ContactID = " & Forms!frmContact!txtSetSchID & ";")
With rs
If .RecordCount > 0 Then
Do Until .EOF
Forms!frmContact!fsubContactAction.Form.txtActionDate = !ActionDate
.MoveNext
Loop
End If
.Close
End With
rs.Close
Set rs = Nothing