This database is for a high school project so it won't actually be used. As a result, I know close to nothing about coding and developed and designed this database from the ground up, so don't crucify me for bad database design.
So, the database records transactions of a certain company.
The transactions are recorded as purchase or sale, the purchase and sale values are pulled from another table.
In the "Sellers" and "Buyers" tables I entered the details of said "company" as SellerID and BuyerID 1, so if a transaction is a purchase, the BuyerID of the transaction must be 1, and vice versa. I want to make it automatic with a macro or module, I'm not sure how to do it.
The best solution would be something like "If 'Purchase/Sale' is 'Purchase', then "[Transactions].[BuyerID] must be 1" and the same thing for Sale. If this is not viable, "If [Transactions].[SellerID]<>1, Then [Transactions].[BuyerID] = 1" or something to that effect. The problem is, I don't know how to write this in code or macros. Thanks for your help.
So, the database records transactions of a certain company.
The transactions are recorded as purchase or sale, the purchase and sale values are pulled from another table.
In the "Sellers" and "Buyers" tables I entered the details of said "company" as SellerID and BuyerID 1, so if a transaction is a purchase, the BuyerID of the transaction must be 1, and vice versa. I want to make it automatic with a macro or module, I'm not sure how to do it.
The best solution would be something like "If 'Purchase/Sale' is 'Purchase', then "[Transactions].[BuyerID] must be 1" and the same thing for Sale. If this is not viable, "If [Transactions].[SellerID]<>1, Then [Transactions].[BuyerID] = 1" or something to that effect. The problem is, I don't know how to write this in code or macros. Thanks for your help.