Re: setting up a one to many link

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



rzitowsk,
First, let me suggest that you use names that are more descriptive. Rather than
"Master List" (avoid spaces) something like tblCustomers or tblClients would be much
clearer. Or tblSales or tblServices instead of just "Transactions".
The same would apply to your "ID" fields... CustomerID, or ClientID, and SalesID or
ServicesID would be much clearer... particularly anyone elese reading your code.

In keeping with what you have now, I'll use MasterID and TransID though...
MasterID is autonumber, TransID should be Numeric Long. Master is the ONE table and
Transactions is the MANY.

If you have entered data into both of these tables already, and then want to link them
using a one to many realtionship... there may be Transactions that have no matching Master
record (orphans), and that is preventing you from creating the proper relationship.
Set up a query that compares Transactions against Master. The link should be "Show all
records in Transactions, and only those in Master where they match.
If the query produces TransIDs with no corresponding MasterID, then those records need
to be deleted before establishing an Integrity and Cascade link. In other words, there
are records right now that violate Integrity and Cascade linking, and therefore you can
not establish that link until those violations are removed.
TransID MasterID
1324 1324
1625 << TransID orphan (delete)
16957 16927
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

<rzitowsk@xxxxxxxxx> wrote in message
news:1171690068.435124.198230@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
How would one set up the one to many link between Master List and
Transactions? If the ID in Master List is a primary key, autonumber
field, and the ID in transactions is not a primary key, number field,
would those two fields link. I have tried such a link but I am not
able to enforce referential integrity or get cascade update related
fields or cascade delete related records?



.



Relevant Pages

  • Re: Two Way Bidirectional Rep
    ... transactional replication is generated, ... the replication engine actually uses to issue the transactions against the ... > use master ... > exec sp_adddistpublisher ...
    (microsoft.public.sqlserver.replication)
  • Re: Updating table looping through fields in the subform.
    ... You have a table I'll call Master, ... >fields OrderNumber, SKU, Quantity, ... >Transactions, with these fields: ... > Exit Sub ...
    (microsoft.public.access.formscoding)
  • Re: maintaining on-hand balances in an inventory
    ... You can drop the trigger idea and drop the inventory level from the item ... I believe keeping the quantity on hand in the item master is normal ... let's assume that your transactions table is as follows ...
    (microsoft.public.sqlserver.programming)
  • Re: DBD::Multiplex, mysql replication and transactions
    ... We've just setup MySQL replication, ... pod to connect to the master and slaves. ... But now I'm running into an issue with transactions. ...
    (perl.dbi.users)
  • Re: maintaining on-hand balances in an inventory
    ... >keeping on-hand balances. ... Inventory levels are maintained in a column ... >in the item master with insert triggers on the transactions table by summing ...
    (microsoft.public.sqlserver.programming)