report.Recordset ??

S

SAm

Hi

I am trying to some how get a parameter from VBA to my query (i don't want
to open the query, i want to open the report docmd.openreport). i was told
that i can do this by opening the query, and then use Report.Recordset. I get
an error when i do this:
run time error '2593': This feature is not available in an MDB
can you help me with this one? i am running 2003, VB version 6.3 i think i
am current with all updates - SP2.

can anybody help ?? my VBA script follows.

sam


report_open sub:

Dim cmdQuery As ADODB.Command
Dim Pa As ADODB.Parameter
Dim rstEmployeeType As ADODB.Recordset

Set cmdQuery = New ADODB.Command
Set Pa = New ADODB.Parameter
Set rstEmployeeType = New ADODB.Recordset
Set cmdQuery.ActiveConnection = CurrentProject.Connection
cmdQuery.CommandText = "EmployeeTypeAnalUQry"
cmdQuery.CommandType = adCmdTable
cmdQuery.Parameters.Refresh

cmdQuery.Parameters(0) = "CADVAN"
cmdQuery.Parameters(1).Value = #9/6/2006#

Set rstEmployeeType = cmdQuery.Execute

Set Me.Recordset = rstEmployeeType
 

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