G
Guest
Hello,
I've been using parameters with an ado command and it works great with until
I add multiple criteria for one value. Any ideas on how to make this work. If
I make the strPeriodPub just ="Oct" it works great but it does not like the
"or" statement. I've experimented with lots of syntax so I don't think that
is it. It may be something with paramenters and commands that I do not know
about.
Thanks
Code
--------------------------------------------------------------------------------
Set cmd = New ADODB.Commandstr
FiscalYearPub = 2003
strPeriodPub = "Oct or Sep"
With cmd
..ActiveConnection = CurrentProject.Connection
..Properties("Jet OLEDB:Stored Query") = True
..CommandText = "qryDetailPL"
..Parameters("[GetPeriod]") = strPeriodPub
..Parameters("[GetFiscalYear]") = Val(strFiscalYearPub)
..Parameters("[Getsource]") = strSource
..Parameters("[GetPartType]") = strPartType
..Parameters("[GetProduct]") = strProduct
Set rst = .Execute
End With
I've been using parameters with an ado command and it works great with until
I add multiple criteria for one value. Any ideas on how to make this work. If
I make the strPeriodPub just ="Oct" it works great but it does not like the
"or" statement. I've experimented with lots of syntax so I don't think that
is it. It may be something with paramenters and commands that I do not know
about.
Thanks
Code
--------------------------------------------------------------------------------
Set cmd = New ADODB.Commandstr
FiscalYearPub = 2003
strPeriodPub = "Oct or Sep"
With cmd
..ActiveConnection = CurrentProject.Connection
..Properties("Jet OLEDB:Stored Query") = True
..CommandText = "qryDetailPL"
..Parameters("[GetPeriod]") = strPeriodPub
..Parameters("[GetFiscalYear]") = Val(strFiscalYearPub)
..Parameters("[Getsource]") = strSource
..Parameters("[GetPartType]") = strPartType
..Parameters("[GetProduct]") = strProduct
Set rst = .Execute
End With