Hi,
I have a main form which consists of 5 tab pages. Each of these pages has a sub form. I have a search page where a user may input search criteria to filter out the data accordingly on the customer detail page which is on another tab.I am having problems with the syntax that should be used. The syntax I use prior to putting these subforms on the tab pages was as follows:
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
Dim DocName As String
Dim LinkCriteria As String
DoCmd.Echo False
DocName = "frmCustDetails"
LinkCriteria = "[Name2] = Forms![frmMainMenu]![SurnameSearch]"
DoCmd.OpenForm DocName, , , LinkCriteria
DocName = "frmMainMenu"
DoCmd.OpenForm "frmMainMenu"
DoCmd.Close
DoCmd.Echo True
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Error$
Resume Exit_Command20_Click
End Sub
Thanks.
I have a main form which consists of 5 tab pages. Each of these pages has a sub form. I have a search page where a user may input search criteria to filter out the data accordingly on the customer detail page which is on another tab.I am having problems with the syntax that should be used. The syntax I use prior to putting these subforms on the tab pages was as follows:
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
Dim DocName As String
Dim LinkCriteria As String
DoCmd.Echo False
DocName = "frmCustDetails"
LinkCriteria = "[Name2] = Forms![frmMainMenu]![SurnameSearch]"
DoCmd.OpenForm DocName, , , LinkCriteria
DocName = "frmMainMenu"
DoCmd.OpenForm "frmMainMenu"
DoCmd.Close
DoCmd.Echo True
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Error$
Resume Exit_Command20_Click
End Sub
Thanks.