Parameter query in dap

  • Thread starter Aga Tech via AccessMonster.com
  • Start date
A

Aga Tech via AccessMonster.com

hi all,
I've a dap that has a parameter query (with 2 groupingdefs) as source for
data.
When I run it the browser prompts me a box to input parameter values and
everithing works well.
Now I'm trying to input parameter values via vba using this command:

MSODSC.RecordsetDefs("My Query").ParameterValues.add ["My Parameter"], "My
value"

But it doesn't work.

Can anyone tell me why?

Please I really need your help!

tanx

P.S.
Sorry for my bad english ;-)
 
O

Ofer

Mybe try a different approch

dim StrParm as string, MyDB as database, MyRec as recordset

StrParm = "select * from MyTable Where Parm1 =" &
LocalParm1 & " Parm2 = " & LocalParm2

Set Mydb = CodeDb
db.QueryDefs("QueryName").sql = StrParm

Set MyRec = Mydb.OpenRecordset("QueryName")

That will build your query with the parameters you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top