
Passing variables to query parameters
Mark,
I am also having a parameter problem. I am getting a Run-time Error 13,
Type mismatch" when trying to pass a value on to a query in the Data
Environment Designer. My code is below. I don't know if this helps you
at all. Also do you see anything wrong with the way I am passing the second
parameter. The second parameter is what is giving me the problem. I know
that I need quotes around the second parameter ( and I think I'm meeting
this requirement) but the Type mismatch error is telling me otherwise.
Dim prodcat As VbVarType
Let prodcat = Chr(39) + dbcombo_ProdCat + Chr(39)
'You must close the recordset before changing the parameter.
If DataEnvironment1.rsUpd_StdCostByProdCat.State = adStateOpen Then
DataEnvironment1.rsUpd_StdCostByProdCat.Close
End If
' Reopen the recordset with the input parameter supplied by
' the TextBox control.
Debug.Print prodcat
DataEnvironment1.Upd_StdCostByProdCat StdCost.Text, prodcat
Quote:
> I have a query command inside a DED that I need to pass 2 variables to.
> I have 2 parameters defined in the query as inpSrc and inpMat.
> I have tried :
> DED.Query(inpSrc , inpMat) = Src , Mat
> ----
> DED.Query(inpSrc , inpMat) = (Src , Mat)
> ----
> DED.Query(inpSrc , inpMat) = DED.Query(Src , Mat)
> ----
> DED.Query(Src , Mat)
> ----
> DED.Query(inpSrc) = Src
> DED.Query(inpMat) = Mat
> ----
> Anyone know the correct way to do this?
> Mark