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
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