Updating table with information

G

Guest

I have a database with 3 tables:

1) ProductDetails - fields are:

Autonumber
ProductType
Cost

2) Products - fields are:

Autonumber
ProductCode
Sold (Yes/No field)

3) Sales Transactions:

Autonumber
ProductCode (lookup of Product table)
ProductType (lookup of Producttype table)
Quantity
Price

I have created a form that references the Sales Transaction table and allows
me enter in the sales tranactions i.e. client buying products.

The issue is - a particular product can only be sold once (thus the reason
for the SOLD field in the product table). I need some way to have the system
flag in the PRODUCT table against the product I have choosen in the form that
the item has been sold.

I am not sure how to do this seeing the form is referencing the Sales
TRansaction table not the Product table itself.

Any thoughts...help...greatly appreciated.
 
S

Squirrel

Hi James,

Your Sales Transactions table does not reference the buyer at all. Are you
tracking sales with no
reference to the buyer? If yes, then consider this simple way to set your
Sold flag to Yes.

Add a button to your form called "Update Sold flag". It will call a query
coded thusly:

"Update Products set Sold = True where ProductCode in
(select ProductCode from SalesTransactions)

If your tablename really has a blank in it then change it to
SalesTransactions.

Also - I'd put the ProductType in the Products table rather than in the
SalesTransactions table.

HTH. Linda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top