I'm pretty clueless at this stuff, but I've managed to put together a query (just can't manage to make it work). Any suggestions would be greatly appreciated.
strSQL = "SELECT DISTINCT tblContractDetails.ContractDetailsID, tblGradingSheet.ContractName, tblGradingSheet.Source" & _
" FROM tblContractDetails INNER JOIN tblGradingSheet ON tblContractDetails.ContractDetailsID = tblGradingSheet.ContractDetailsID" & _
" WHERE tblGradingSheet.ContractName = " & Forms!frmRawProductGradingPeas!subfrmGradingSheet.Form!txtContractName & " AND" & _
" tblGradingSheet.Source = " & Forms!frmRawProductGradingPeas!subfrmGradingSheet.Form!txtSource
I'm trying to get the value of the ContractDetailsID, but every time I run this sub I get the error: Too few parameters. Expected 3
strSQL = "SELECT DISTINCT tblContractDetails.ContractDetailsID, tblGradingSheet.ContractName, tblGradingSheet.Source" & _
" FROM tblContractDetails INNER JOIN tblGradingSheet ON tblContractDetails.ContractDetailsID = tblGradingSheet.ContractDetailsID" & _
" WHERE tblGradingSheet.ContractName = " & Forms!frmRawProductGradingPeas!subfrmGradingSheet.Form!txtContractName & " AND" & _
" tblGradingSheet.Source = " & Forms!frmRawProductGradingPeas!subfrmGradingSheet.Form!txtSource
I'm trying to get the value of the ContractDetailsID, but every time I run this sub I get the error: Too few parameters. Expected 3