P
pacmedtran
Hi,
I'm having trouble opening a recordset in Word VBA to use Access data in a
macro. Here is the code:
Set objAccess = CreateObject("Access.Application")
objAccess.DoCmd.SetWarnings False
objAccess.OpenCurrentDatabase "PUTR.mdb"
objAccess.DoCmd.OpenTable "ReadyList"
Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
Dim varRecordSet1 As New ADODB.Recordset
varRecordSet1.ActiveConnection = cnn1
The trouble comes at the last line, where I get a 3001 error that the
argument is the wrong type, out of range or in conflict. That's as much help
as I get.
I do have the ActiveX Data Objects 2.1 object library referenced. As far as
I can see, this ought to work, but I can't see what's wrong. If anybody
could point out the obvious for me, I'd really appreciate it.
I'm having trouble opening a recordset in Word VBA to use Access data in a
macro. Here is the code:
Set objAccess = CreateObject("Access.Application")
objAccess.DoCmd.SetWarnings False
objAccess.OpenCurrentDatabase "PUTR.mdb"
objAccess.DoCmd.OpenTable "ReadyList"
Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
Dim varRecordSet1 As New ADODB.Recordset
varRecordSet1.ActiveConnection = cnn1
The trouble comes at the last line, where I get a 3001 error that the
argument is the wrong type, out of range or in conflict. That's as much help
as I get.
I do have the ActiveX Data Objects 2.1 object library referenced. As far as
I can see, this ought to work, but I can't see what's wrong. If anybody
could point out the obvious for me, I'd really appreciate it.