Change default value without influencing old records

J

jaworski_m

There are the following tables:

tblSuppliers
supplierName (PK)
invoicePaymentTime
(other fields)

tblGoods
goodsID (PK)
goodsName
supplierName (FK)

Each time I choose a "Supplier Name" I want "Invoice Payment Time" to be
filled with a corresponding value (30,60 days etc.).
My form uses a combo box for supplier name which asigns these values.

QUESTION:
In case "Invoice Payment Time" for a supplier changes (30 -> 45 days) I want
a new value to be used for new records and don't modify existing ones.

The above described design doesn't allow this. How should it be improved?

Thank you for suggestions.

winXP
access 2003
 
J

John W. Vinson

There are the following tables:

tblSuppliers
supplierName (PK)
invoicePaymentTime
(other fields)

tblGoods
goodsID (PK)
goodsName
supplierName (FK)

Each time I choose a "Supplier Name" I want "Invoice Payment Time" to be
filled with a corresponding value (30,60 days etc.).
My form uses a combo box for supplier name which asigns these values.

QUESTION:
In case "Invoice Payment Time" for a supplier changes (30 -> 45 days) I want
a new value to be used for new records and don't modify existing ones.

The above described design doesn't allow this. How should it be improved?

Thank you for suggestions.

winXP
access 2003

Your table design makes this impossible. You'll need to store either the
invoice payment time or the due date in your invoice table, since its value
cannot be calculated, since you need not only the current InvoicePaymentTime
but its value at a point in time in the past.
 
J

jaworski_m

Thank you for reply.

If "Invoice payment time" should be in invoice table, how can I provide a
default value (stored in some location) for this field depending on which
supplier is chosen i.e.:

- supplier A - payment 30days
- supplier B - payment 60days
- etc.?
 
J

Jeanette Cunningham

Add a new field to the Suppliers table.
Make it a text field to show the current payment terms for each supplier.

Add the payment terms field/column to the query for the combo and add an
extra column to the combo.
You can make that column in the combo a hidden one if you like.
After chooses a supplier from the combo, your code sets the invoice payment
time field using that value from the extra column in the combo.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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