Update a linked table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to update a linked table by creating a
function which sets a recordset variable to the linked
table.

Set recNew = dbCurr.OpenRecordset("testjob", dbOpenDynaset)
If recNew.RecordCount > 0 Then
recNew.MoveFirst
Do While Not recNew.EOF
recNew.Edit
recNew!posted = True
recNew.Update
recNew.MoveNext
Loop
End If

It fails when it gets to recNew.Edit, I get a runtime
error '3000'. I am able to update the table by opening in
datasheet view. Any help would be greatly appreciated.
 
Set recNew = CurrentDB.OpenRecordset("testjob", dbOpenDynaset)


--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
I assigned the variable dbCurr to the Current DB, the
below statement does not work. Any other suggestions?
 
Is "testjob" an Access table ? Only tables can be opened as a Dynaset.
Have you looked at the error 3000 description ?
Is recNew dimensioned as a DAO recordset ?

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Only tables can be opened as a Dynaset.

Where did you get that from? Any SELECT query can be opened as a dynaset
and is in fact the recommended way to use DAO to access any data.

Tim F
 
I was thinking of the case where you open a query on a non-Access table,
like a text csv file. Then it cannot be a Dynaset AFAIK.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Back
Top