I'm trying to filter a subform. The main form is frmDataEntry, the subform is frmDataEntry2, and the criteria for the filter is a combo box cboNP on a form frmMainSwitchboard. My current code is as follows:
===========================================================
Dim stDocName, strSQL As String
Dim stLinkCriteria As String
stDocName = "frmDataEntry"
DoCmd.OpenForm stDocName, , , stLinkCriteria
strSQL = "Select * from tblPlan where"
strSQL = strSQL & " [NP]=" & Forms![frmMainSwitchboard]![cboNP]
Me.[frmDataEntry2].Form.RecordSource = strSQL
===========================================================
Any help will be greatly appreciated, Kopy
===========================================================
Dim stDocName, strSQL As String
Dim stLinkCriteria As String
stDocName = "frmDataEntry"
DoCmd.OpenForm stDocName, , , stLinkCriteria
strSQL = "Select * from tblPlan where"
strSQL = strSQL & " [NP]=" & Forms![frmMainSwitchboard]![cboNP]
Me.[frmDataEntry2].Form.RecordSource = strSQL
===========================================================
Any help will be greatly appreciated, Kopy