 |
Access VBA Discuss using VBA for Access programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

July 28th, 2004, 10:25 AM
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Linked Tables
I'm trying to delete records on a table but I can't.
1) How do I find out what other table it is liked to.
2) How do I delete records on a table that is linked to another table?
I'm using Access 97/ VBA
|

July 28th, 2004, 01:33 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Do you mean "joined"? The two tables have a join established between them with referential integrity enforced. That prevents you from deleting a record in a child table if it contains a foreign key to a record in the primary table. You would have to delete the record in the primary table first. To view the relationhsip between the two tables, click the Relationships toolbar button in the Database Window. You can delete a relationship (or set its properties) by right clicking on the line that joins the two tables in the relationships window.
HTH,
Bob
|

July 28th, 2004, 01:42 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
The same holds true if you are actually talking about a "linked" table, but in that case, you would need to edit or delete the relatioinship in the backend database. You can't edit or delete relatioinships inherited from a linked database.
Bob
|

July 28th, 2004, 03:01 PM
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I don't really know if the table is linked or joined. When I right click the table and select properties, it says "Table: Linked Access". Also, when I click on relationship I see nothing. However, When I select to view the relationship while in the Backend I see most of the tables that are joined. Unfortunately, I don't see the table in question. Now I am really lost. I still donât know how to find out to who the table is linked or joined to, or what table is the primary table.
Thanks for any help
|

July 28th, 2004, 04:09 PM
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OK, My Bad, I went to the Front End and right clicked on the blank relationship window and selected "show all" and I included the table in question. Unfortunately, that table does not have a relationship line. Now what do I do????
Thanks for any help
|

July 28th, 2004, 04:37 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Quote:
quote:that table does not have a relationship line
|
Does it have a primary key defined? Not having one can cause linked tables to be read-only.
Bob
|

July 28th, 2004, 05:08 PM
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I apologies for my ignorance but I am really new at this. How do I find out if it has a primary key defined? I donât think the table is read-only because I can write to it just find. Furthermore, the reason I think itâs a linked table is because when I click to open the design it warns me with the fallowing:
âTable âxxxxxâ is a linked table with some properties that canât be modified.
Thanks in advanced r any help
|
|
 |