A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Change default value without influencing old records



 
 
Thread Tools Display Modes
  #1  
Old December 4th, 2009, 06:09 PM posted to microsoft.public.access.tablesdbdesign
jaworski_m
external usenet poster
 
Posts: 28
Default Change default value without influencing old records

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
  #2  
Old December 5th, 2009, 01:48 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Change default value without influencing old records

On Fri, 4 Dec 2009 09:09:01 -0800, jaworski_m
wrote:

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.
--

John W. Vinson [MVP]
  #3  
Old December 5th, 2009, 09:53 PM posted to microsoft.public.access.tablesdbdesign
jaworski_m
external usenet poster
 
Posts: 28
Default Change default value without influencing old records

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.?



"John W. Vinson" wrote:

On Fri, 4 Dec 2009 09:09:01 -0800, jaworski_m
wrote:

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.
--

John W. Vinson [MVP]
.

  #4  
Old December 5th, 2009, 10:03 PM posted to microsoft.public.access.tablesdbdesign
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Change default value without influencing old records

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


"jaworski_m" wrote in message
...
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.?



"John W. Vinson" wrote:

On Fri, 4 Dec 2009 09:09:01 -0800, jaworski_m
wrote:

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.
--

John W. Vinson [MVP]
.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.