M
Mona C. via AccessMonster.com
I have a listpage which is a subform in datasheet view that lists a subset of
records. I have 17 records that show up on this listpage. When the User
double-clicks on the record row, it opens the detail record form to the
record that was clicked. My problem is that it will only filter to that
record. How can I get it to go to a specific record, but then if I want to
search for another record, on this same detail form or click the next record
button, it will pull in the next record.
I guess I need it to filter in order to pull into the detail record the
record clicked on the listpage, but I also want all the records to be
accessible to this form instead of just the one record as it is doing now.
Here's my code:
Private Sub Form_DblClick(Cancel As Integer)
' This double-clicks on the record on the listpage. It should open the form
' to the record clicked, but Need to bring in all records, so they can be
searched later
' within the form.
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
DoCmd.OpenForm "frmResolution", WhereCondition:="TrackingNo =" &
TrackingNo
rs.FindFirst "[TrackingNo] = " & Str(Nz(Me![tblDataEntry.TrackingNo], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
'close the list page after detail form is opened
DoCmd.Close acForm, "frmListPage"
End Sub
records. I have 17 records that show up on this listpage. When the User
double-clicks on the record row, it opens the detail record form to the
record that was clicked. My problem is that it will only filter to that
record. How can I get it to go to a specific record, but then if I want to
search for another record, on this same detail form or click the next record
button, it will pull in the next record.
I guess I need it to filter in order to pull into the detail record the
record clicked on the listpage, but I also want all the records to be
accessible to this form instead of just the one record as it is doing now.
Here's my code:
Private Sub Form_DblClick(Cancel As Integer)
' This double-clicks on the record on the listpage. It should open the form
' to the record clicked, but Need to bring in all records, so they can be
searched later
' within the form.
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
DoCmd.OpenForm "frmResolution", WhereCondition:="TrackingNo =" &
TrackingNo
rs.FindFirst "[TrackingNo] = " & Str(Nz(Me![tblDataEntry.TrackingNo], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
'close the list page after detail form is opened
DoCmd.Close acForm, "frmListPage"
End Sub