J
jonathan
Hi, i have a mainform (frmJob) with a subform (frmtasks), they is a 1 to
many relationship through TaskID. I also have a results form that displays
information about the records in the subform (these records also have the
TaskID in them). At the moment when i double click the results record it
takes me to the Parent record in the main form, This is fine but i still
have to find the subform record i doulbe clicked on in my results form. I
would like the main form to open and setfocus on the record in the subform
that i double clicked on in my results form using taskID as the link.
What i have done so far is create variable of TASKID. When i double click
the record in the results form it captures this, then on the load event of
the frmtasks i got it do a recordsetclose then a findfirst but it's not
working. Can some pls help me with correct synax and also how do i set the
focus on the record it finds. This is what i had.
Dim rs As DAO.Recordset
If IsNull(strtaskid) Then
'do nothing
Else
Set rs = Me.RecordsetClone
If Not rs.BOF And Not rs.EOF Then
rs.MoveFirst
Do Until rs.EOF
rs.FindFirst "[TaskID] = " & strtaskid
Exit Do
rs.MoveNext
Loop
End If
End If
Set rs = Nothing
many relationship through TaskID. I also have a results form that displays
information about the records in the subform (these records also have the
TaskID in them). At the moment when i double click the results record it
takes me to the Parent record in the main form, This is fine but i still
have to find the subform record i doulbe clicked on in my results form. I
would like the main form to open and setfocus on the record in the subform
that i double clicked on in my results form using taskID as the link.
What i have done so far is create variable of TASKID. When i double click
the record in the results form it captures this, then on the load event of
the frmtasks i got it do a recordsetclose then a findfirst but it's not
working. Can some pls help me with correct synax and also how do i set the
focus on the record it finds. This is what i had.
Dim rs As DAO.Recordset
If IsNull(strtaskid) Then
'do nothing
Else
Set rs = Me.RecordsetClone
If Not rs.BOF And Not rs.EOF Then
rs.MoveFirst
Do Until rs.EOF
rs.FindFirst "[TaskID] = " & strtaskid
Exit Do
rs.MoveNext
Loop
End If
End If
Set rs = Nothing