Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit a recordset direct in a linked table

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB
Hi
I have a database with forms and queries and the tables linked to a seperate database.

How can I updated the recordset in a linked table directly from a form in the other database.

I can do it if the tables were in the same database as the queries and forms using but how would i change the code to update a linked table?

Code:
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("tblxxx)
rst.Index = "PrimaryKey"
rst.Seek "=", Me.xxxx
rst.Edit
rst!xxx = Date
rst!.Update
rst.Close
 
If it's linked, then code will treat it the same - what error are you getting with your logic?

I assume that the missing <red>"</red> on

Code:
Set rst = CurrentDb.OpenRecordset("tblxxx)

is just a typo?

JB
 
yes its a typo

If I leave the code as above I get the message

"Operation is not supported for this type of object"

Worked when I had them all the tables with the queries and forms together
 
which line is highlighted with the error mate?

Have you tried it without the DAO, just:

dim rst as recordset
set rst=currentdb.openrecordset("XX", dbopendynanset)

and then

rst.findfirst "YourField=" & me.xxx

finally,

rst!.update

The bang (!) is typo too right? Cos naturally it should be just .

Hope this helps, JB




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top