PC Review


Reply
Thread Tools Rate Thread

Changing Function

 
 
Elizabeth- MDC
Guest
Posts: n/a
 
      7th Oct 2008
Database tracking points based rewards system for a mall.

One table keeps rules for calculation how many points are rewarded for a
given purchase. There could be a hundred rules that change from month to
month. They include things like points per dollar spent, rewards that apply
only to one store, upper limits on points per transaction, etc.

What is the best way to define a function that will calculate the correct
number of points based on said rules. I could do my own Calculate_Points
function, but every time I call it it would have to reference the "Rules"
Table.

It would be better to have a fixed function that could be updated on command
or upon opening the program, so that the calculations run faster.

Is there a way to use a sub to create a new function, or should I just
update the query that populates the table recording the points?
 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      8th Oct 2008
On Tue, 7 Oct 2008 11:20:04 -0700, Elizabeth- MDC
<(E-Mail Removed)> wrote:

There is nothing wrong with referencing the Rules table every time, is
there? If you are concerned about performance, don't be until you
prove it is an issue. Then you could open a recordset at Startup time,
and not close it until the app closes. The recordset then becomes a
fancy array that will be VERY fast.
Doing simple math against a hundred or so records should yield
sub-second results.

-Tom.
Microsoft Access MVP




>Database tracking points based rewards system for a mall.
>
>One table keeps rules for calculation how many points are rewarded for a
>given purchase. There could be a hundred rules that change from month to
>month. They include things like points per dollar spent, rewards that apply
>only to one store, upper limits on points per transaction, etc.
>
>What is the best way to define a function that will calculate the correct
>number of points based on said rules. I could do my own Calculate_Points
>function, but every time I call it it would have to reference the "Rules"
>Table.
>
>It would be better to have a fixed function that could be updated on command
>or upon opening the program, so that the calculations run faster.
>
>Is there a way to use a sub to create a new function, or should I just
>update the query that populates the table recording the points?

 
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 to a function or sub John Microsoft Access Form Coding 5 29th Jul 2010 05:18 PM
VBA function changing its name John B. Smotherman Microsoft Access VBA Modules 0 24th May 2010 03:56 PM
VBA function changing name John B. Smotherman Microsoft Access VBA Modules 0 24th May 2010 02:51 PM
NOW() function that is un-changing =?Utf-8?B?Q2hlZXNl?= Microsoft Excel Misc 7 19th Mar 2007 12:51 AM
Changing a delete function to an export function =?Utf-8?B?bm1hcmFubw==?= Microsoft Access VBA Modules 4 11th Mar 2005 01:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:35 PM.