PC Review


Reply
Thread Tools Rate Thread

how do I update a default value without changing the values of pr.

 
 
Abel O
Guest
Posts: n/a
 
      16th Jan 2008
I usually calculate a price by multiplying a default value by another value.
Periodically, I need to change the default value to reflect inflation, etcc,
but I don't want that change to affect previous calculations. So how can I
change the default value to take effect only from a specific date.

I don't know how to use expressions in Access and hope there is a simple
design method to do it.
 
Reply With Quote
 
 
 
 
KARL DEWEY
Guest
Posts: n/a
 
      16th Jan 2008
Where are you applying the 'Default'? Field in a table, form, report?
What is your complete expression?
--
KARL DEWEY
Build a little - Test a little


"Abel O" wrote:

> I usually calculate a price by multiplying a default value by another value.
> Periodically, I need to change the default value to reflect inflation, etcc,
> but I don't want that change to affect previous calculations. So how can I
> change the default value to take effect only from a specific date.
>
> I don't know how to use expressions in Access and hope there is a simple
> design method to do it.

 
Reply With Quote
 
Abel O
Guest
Posts: n/a
 
      16th Jan 2008
Thank you for your reply, Karl. I am a translator and I normally calculate
the price for a translation by multiplying a default rate (a field in a
table) per 1000 words. E.g. I charge £60 per 1000 words. However, I now want
to change the default rate to £65/1000 words from (today) onwards, without
changing all the past calculations, as this would mess up my records.

I hope this clarifies things.

"KARL DEWEY" wrote:

> Where are you applying the 'Default'? Field in a table, form, report?
> What is your complete expression?
> --
> KARL DEWEY
> Build a little - Test a little
>
>
> "Abel O" wrote:
>
> > I usually calculate a price by multiplying a default value by another value.
> > Periodically, I need to change the default value to reflect inflation, etcc,
> > but I don't want that change to affect previous calculations. So how can I
> > change the default value to take effect only from a specific date.
> >
> > I don't know how to use expressions in Access and hope there is a simple
> > design method to do it.

 
Reply With Quote
 
KARL DEWEY
Guest
Posts: n/a
 
      16th Jan 2008
Add an 'Effective' date field in the table that has the default rate field.
Then in your queries where you use the rate have date criteria to select the
rate to be used.
--
KARL DEWEY
Build a little - Test a little


"Abel O" wrote:

> Thank you for your reply, Karl. I am a translator and I normally calculate
> the price for a translation by multiplying a default rate (a field in a
> table) per 1000 words. E.g. I charge £60 per 1000 words. However, I now want
> to change the default rate to £65/1000 words from (today) onwards, without
> changing all the past calculations, as this would mess up my records.
>
> I hope this clarifies things.
>
> "KARL DEWEY" wrote:
>
> > Where are you applying the 'Default'? Field in a table, form, report?
> > What is your complete expression?
> > --
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "Abel O" wrote:
> >
> > > I usually calculate a price by multiplying a default value by another value.
> > > Periodically, I need to change the default value to reflect inflation, etcc,
> > > but I don't want that change to affect previous calculations. So how can I
> > > change the default value to take effect only from a specific date.
> > >
> > > I don't know how to use expressions in Access and hope there is a simple
> > > design method to do it.

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      16th Jan 2008
On Wed, 16 Jan 2008 09:42:01 -0800, Abel O <(E-Mail Removed)>
wrote:

>Thank you for your reply, Karl. I am a translator and I normally calculate
>the price for a translation by multiplying a default rate (a field in a
>table) per 1000 words. E.g. I charge £60 per 1000 words. However, I now want
>to change the default rate to £65/1000 words from (today) onwards, without
>changing all the past calculations, as this would mess up my records.


Where do you store the "default rate"?
Where do you store the calculated value - or do you store it?
How do you do the calculation?

We're not there. We can't see your computer, and don't know how you're doing
this - so we can't tell you how to change what you're doing.

John W. Vinson [MVP]
 
Reply With Quote
 
Ken Sheridan
Guest
Posts: n/a
 
      16th Jan 2008
This is a question of functional dependence. Its commonly encountered with
invoices where the unit price of a product will change with time but each
invoice record need to keep the price at the time that the invoice was
raised. You'll find an example in the sample Northwind database where the
Orders Subform looks up the current default unit price from the products
table and assigns it to the unit price in the Order Details table with the
following code in the ProductID combo box's AfterUpdate event procedure:

On Error GoTo Err_ProductID_AfterUpdate

Dim strFilter As String

' Evaluate filter before it's passed to DLookup function.
strFilter = "ProductID = " & Me!ProductID

' Look up product's unit price and assign it to UnitPrice control.
Me!UnitPrice = DLookup("UnitPrice", "Products", strFilter)

Exit_ProductID_AfterUpdate:
Exit Sub

Err_ProductID_AfterUpdate:
MsgBox Err.Description
Resume Exit_ProductID_AfterUpdate

Consequently when the unit price values in the Products table change the
unit price values already in the Order details table are unaffected, but new
rows in that table use the current prices from the Products table.

In relational speak the current unit price is functionally dependent on the
key of Products, but the unit price for each order item is functionally
dependent on the key of Order Details, hence the need for unit price columns
in both tables.

Your situation is, I think, analogous to this and can be handled in the same
way, in fact more simply so if you have just the one default rate as you only
need to look up the one value rather than the value for a particular product,
so when adding a new record you can simply assign the value in the form's
BeforeInsert event procedure. If your current rate is in a column
CurrentRate in a one row table tblCurrentRate say, and the column in the
form's underlying table is called RateApplicable the code would be:

Me.RateApplicable = DLookup("CurrentRate", "tblCurrentRate")

The gross fee would then be in a computed control which multiplies the
RateApplicable by the ThousandsOfWords control, i.e. with a ControlSource of:

=[ RateApplicable]*[ ThousandsOfWords]

or if you are storing the gross fee in a column in the table rather than the
rate applicable you can look up the value and multiply it by the
ThousandsOfWords value and assign it to the GrossFee control all in one in
the ThousandsOfWords controls AfterUpdate event procedure:

Me.GrossFee = DLookup("CurrentRate", "tblCurrentRate") * Me. ThousandsOfWords

Normally in situations like this, however, one would tend to do the former,
i.e. store the values on which the calculation is based, i.e. RateApplicable
and ThousandsOfWords in columns in the table and compute the gross fee on the
fly in a computed control or computed column in a query. You'll see that the
Northwind database does it this way, returning the Extended Price in a
computed column in the Orders Subform's underlying query, based on the stored
UnitPrice, Quantity and Discount values.

Ken Sheridan
Stafford, England

"Abel O" wrote:

> Thank you for your reply, Karl. I am a translator and I normally calculate
> the price for a translation by multiplying a default rate (a field in a
> table) per 1000 words. E.g. I charge £60 per 1000 words. However, I now want
> to change the default rate to £65/1000 words from (today) onwards, without
> changing all the past calculations, as this would mess up my records.
>
> I hope this clarifies things.
>
> "KARL DEWEY" wrote:
>
> > Where are you applying the 'Default'? Field in a table, form, report?
> > What is your complete expression?
> > --
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "Abel O" wrote:
> >
> > > I usually calculate a price by multiplying a default value by another value.
> > > Periodically, I need to change the default value to reflect inflation, etcc,
> > > but I don't want that change to affect previous calculations. So how can I
> > > change the default value to take effect only from a specific date.
> > >
> > > I don't know how to use expressions in Access and hope there is a simple
> > > design method to do it.


 
Reply With Quote
 
Roger
Guest
Posts: n/a
 
      17th Jan 2008
Default values are "from this day forward." They have absolutely no effect
on historic data.
--
Roger


"KARL DEWEY" wrote:

> Add an 'Effective' date field in the table that has the default rate field.
> Then in your queries where you use the rate have date criteria to select the
> rate to be used.
> --
> KARL DEWEY
> Build a little - Test a little
>
>
> "Abel O" wrote:
>
> > Thank you for your reply, Karl. I am a translator and I normally calculate
> > the price for a translation by multiplying a default rate (a field in a
> > table) per 1000 words. E.g. I charge £60 per 1000 words. However, I now want
> > to change the default rate to £65/1000 words from (today) onwards, without
> > changing all the past calculations, as this would mess up my records.
> >
> > I hope this clarifies things.
> >
> > "KARL DEWEY" wrote:
> >
> > > Where are you applying the 'Default'? Field in a table, form, report?
> > > What is your complete expression?
> > > --
> > > KARL DEWEY
> > > Build a little - Test a little
> > >
> > >
> > > "Abel O" wrote:
> > >
> > > > I usually calculate a price by multiplying a default value by another value.
> > > > Periodically, I need to change the default value to reflect inflation, etcc,
> > > > but I don't want that change to affect previous calculations. So how can I
> > > > change the default value to take effect only from a specific date.
> > > >
> > > > I don't know how to use expressions in Access and hope there is a simple
> > > > design method to do it.

 
Reply With Quote
 
Ken Sheridan
Guest
Posts: n/a
 
      17th Jan 2008
Roger:

The OP appears not to be referring to the DefaultValue property but to a
value stored at a column position in a row in a referenced table. If this
value is updated then any existing rows in the result set of a query which
joins the referenced table to a referencing table will reflect the new value.
They should of course retain the value it the time the row was inserted into
the table. This seems to be where the OP is going wrong; there needs to be a
column in the referencing table to which the value in the referenced table is
assigned when a row is inserted into the table.

Ken Sheridan
Stafford, England

"Roger" wrote:

> Default values are "from this day forward." They have absolutely no effect
> on historic data.
> --
> Roger
>
>
> "KARL DEWEY" wrote:
>
> > Add an 'Effective' date field in the table that has the default rate field.
> > Then in your queries where you use the rate have date criteria to select the
> > rate to be used.
> > --
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "Abel O" wrote:
> >
> > > Thank you for your reply, Karl. I am a translator and I normally calculate
> > > the price for a translation by multiplying a default rate (a field in a
> > > table) per 1000 words. E.g. I charge £60 per 1000 words. However, I now want
> > > to change the default rate to £65/1000 words from (today) onwards, without
> > > changing all the past calculations, as this would mess up my records.
> > >
> > > I hope this clarifies things.
> > >
> > > "KARL DEWEY" wrote:
> > >
> > > > Where are you applying the 'Default'? Field in a table, form, report?
> > > > What is your complete expression?
> > > > --
> > > > KARL DEWEY
> > > > Build a little - Test a little
> > > >
> > > >
> > > > "Abel O" wrote:
> > > >
> > > > > I usually calculate a price by multiplying a default value by another value.
> > > > > Periodically, I need to change the default value to reflect inflation, etcc,
> > > > > but I don't want that change to affect previous calculations. So how can I
> > > > > change the default value to take effect only from a specific date.
> > > > >
> > > > > I don't know how to use expressions in Access and hope there is a simple
> > > > > design method to do it.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing & recalculating default values on a form Bob Quintal Microsoft Access 1 22nd Dec 2007 02:23 PM
changing table default values =?Utf-8?B?UEFM?= Microsoft Word Document Management 0 8th Jun 2006 02:29 PM
changing table default values =?Utf-8?B?UEFM?= Microsoft Word Document Management 0 8th Jun 2006 02:29 PM
changing Default Values Paul Simon Microsoft Access Database Table Design 3 4th Apr 2004 11:46 PM
changing default task status values Stephen Russell Microsoft Outlook 0 13th Aug 2003 12:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:43 PM.