I have a SQL statement to call data using a form. however, it keeps generating a "[3061]: Too few parameters. Expected 1" error.
I've attempted to convert it to queryDef, however, no progress has been made.
Any guidance, would be appreciated.
the original code is as such:
** Edit **
even if quotes singles are placed around the form value, the query will run but returns no records.
I've attempted to convert it to queryDef, however, no progress has been made.
Any guidance, would be appreciated.
the original code is as such:
Code:
Dim dbs As DAO.Database
Dim rstTemp As DAO.Recordset
Dim strSQL As String
Set dbs = CurrentDb()
'**** create output table
'Delete temporary table
'DoCmd.RunSQL "DROP TABLE tbl_MktPOsHash;"
strSQL = "SELECT FIMSMGR_FTVACCI.FTVACCI_FUND_CODE, " & _
"tbl_MktPOs.Date, " & _
"tbl_MktPOs.PO, " & _
"tbl_MktPOs.POAmt, " & _
"tbl_MktPOs.BlnkWvr, " & _
"tbl_MktPOs.SC, " & _
"tbl_MktPOs.Buyer, " & _
"tbl_MktPOs.Desc, " & _
"tbl_MktPOs.PO_Originated, " & _
"tbl_MktPOs.Index, " & _
"tbl_MktPOs.CORD_No, " & _
"tbl_MktPOs.BuyerUserName, " & _
"tbl_MktPOs.BuyerLastName, " & _
"tbl_MktPOs.BuyerFirstName, " & _
"tbl_MktPOs.BuyerMkt, " & _
"tbl_MktPOs.[Replenishment Order], " & _
"tbl_MktPOs.[Contract Name], " & _
"tbl_MktPOs.[Contract No], " & _
"tbl_MktPOs.[Contract Expiration Date] " & _
"FROM tbl_MktPOs " & _
"INNER JOIN FIMSMGR_FTVACCI " & _
"ON tbl_MktPOs.Index = FIMSMGR_FTVACCI.FTVACCI_ORGN_CODE " & _
"WHERE (((FIMSMGR_FTVACCI.FTVACCI_FUND_CODE) Like 'R*') AND " & _
"((FIMSMGR_FTVACCI.FTVACCI_NCHG_DATE)=#12/31/2099#) AND " & _
"((tbl_MktPOs.BlnkWvr) Like 'W' & [Forms]![F_Waiver_Yr]![Txt_Waiver_Yr] & '*B-001'));"
Set rstTemp = dbs.OpenRecordset(strSQL)
even if quotes singles are placed around the form value, the query will run but returns no records.
Code:
"WHERE (((FIMSMGR_FTVACCI.FTVACCI_FUND_CODE) Like 'R*') AND " & _
"((FIMSMGR_FTVACCI.FTVACCI_NCHG_DATE)=#12/31/2099#) AND " & _
"((tbl_MktPOs.BlnkWvr) Like 'W' & '[Forms]![F_Waiver_Yr]![Txt_Waiver_Yr]' & '*B-001'));"
Comment