Hi, I created a form to select client name. Double click on list box selection and wish to open another form that has a subform in control tab number 2.
I could not find any help in previous posts. Tks for any help.
Here is the code:
Private Sub SearchResults_DblClick(Cancel As Integer)
On Error Resume Next
Dim stDocName As String
Dim stLinkCriteria As String
Dim frm As Form
Set frm = Forms!SelectName
DoCmd.Echo False
stDocName = [Forms!FrmMainFrm!FrmResultSub.Form.ControlName ???
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord acDataForm, stDocName, acNewRec
stLinkCriteria = "[IdName]=" & Me![SearchResults]
Set frm = Nothing
DoCmd.Echo True
DoCmd.Close acForm, "Forms!SelectName", acSaveNo
End Sub
I could not find any help in previous posts. Tks for any help.
Here is the code:
Private Sub SearchResults_DblClick(Cancel As Integer)
On Error Resume Next
Dim stDocName As String
Dim stLinkCriteria As String
Dim frm As Form
Set frm = Forms!SelectName
DoCmd.Echo False
stDocName = [Forms!FrmMainFrm!FrmResultSub.Form.ControlName ???
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord acDataForm, stDocName, acNewRec
stLinkCriteria = "[IdName]=" & Me![SearchResults]
Set frm = Nothing
DoCmd.Echo True
DoCmd.Close acForm, "Forms!SelectName", acSaveNo
End Sub