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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a linked table

Status
Not open for further replies.

sturner333

Programmer
Jan 19, 2004
67
US
I have a database with tables that are already linkes to other forms, etc.
How do you update these tables, like add new rows? When you open and/or save in the design mode, it say the linked table can not be updated.
Thanks
 
Do you mean table design mode?

If so that is just saying that you can't modify the structure of a linked table. You can still add, delete, update records in the table just as you would for a local table.
 
The problem has nothing to do with the fact that you have forms. The message you are getting indicates that you are not actually opening the table, you are opening a shortcut to the table. The file you are in is just the front-end of a database. The tables reside in a different file.

How to add rows? You said you have a form. That's what it's for.

If you meant to ask how to add new columns, you will need to open the back-end file to do that.

 
Yes, table design mode. So there is absolutely no way to add more rows to the table once it is linked?
Thanks
 
Of course there is. For example
Code:
INSERT INTO LinkedTable (fld1, fld2, fld3)
            VALUES ( 1, 2, 3 )
will insert a new row in the table.

or in code
Code:
Dim rs As Recordset
Set rs = Currentdb.OpenRecordset ( "LinkedTable" )
rs.AddNew
rs![fld1] = 1
rs![fld2] = 2
rs![fld3] = 3
rs.Update
does the same thing.

What you cannot do to a linked table is add new columns (or delete them or redefine them or build indexes). That is everything that you can do in the table design window.

There are ways to do this of course but they involve accessing the table in the database where it actually exists rather than the one in which it is linked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top