G
Guest
Hello,
I am having some trouble trying to figure out how to double click a record
from datasheet view in one subform and have it open an unbound form and go to
a record in subform in it.
'FRM_Main_Search' is the unbound form containing the subform I want to find
the record in.
Any help would be fantastic!! thanks
Private Sub Form_DblClick(Cancel As Integer)
stDocName = "FRM_Dws_main_search"
If Me.Dirty Then Me.Dirty = False
DoCmd.OpenForm stDocName, , , stLinkCriteria
Dim frm As Form
Dim strWhere As String
strWhere = Forms![FRM_Dws_main_search].[FRM_DWS_Core_Search].Form.ID = "
& Me.[ID] & "
Set frm = Forms![FRM_Dws_main_search].[FRM_DWS_Core_Search].Form
With frm.RecordsetClone
Debug.Print strWhere
.FindFirst strWhere
If .NoMatch Then
MsgBox "Not found. Is the form filtered?"
Else
'Selects and stays on record the user has come from
frm.Bookmark = .Bookmark
End If
End With
End Sub
I am having some trouble trying to figure out how to double click a record
from datasheet view in one subform and have it open an unbound form and go to
a record in subform in it.
'FRM_Main_Search' is the unbound form containing the subform I want to find
the record in.
Any help would be fantastic!! thanks
Private Sub Form_DblClick(Cancel As Integer)
stDocName = "FRM_Dws_main_search"
If Me.Dirty Then Me.Dirty = False
DoCmd.OpenForm stDocName, , , stLinkCriteria
Dim frm As Form
Dim strWhere As String
strWhere = Forms![FRM_Dws_main_search].[FRM_DWS_Core_Search].Form.ID = "
& Me.[ID] & "
Set frm = Forms![FRM_Dws_main_search].[FRM_DWS_Core_Search].Form
With frm.RecordsetClone
Debug.Print strWhere
.FindFirst strWhere
If .NoMatch Then
MsgBox "Not found. Is the form filtered?"
Else
'Selects and stays on record the user has come from
frm.Bookmark = .Bookmark
End If
End With
End Sub