# Thread: Values entere via form (Acc2K)

1. ## Values entere via form (Acc2K)

I am looking for ideas. I have a school employee database that updates deductions from payroll. Each year these values change. I would like to have a form that the operator could enter the new values, then use code to calculate.
What would be the best way to implement such a task. I appreciate any help.....

2. ## Re: Values entere via form (Acc2K)

I think you're going to have to be a bit more detailed about the kind of deductions and calculations you want to do in order to get useful replies. Are you talking about payroll withholding for income taxes, social security, deferred compensation, Flexible Spending Account, health insurance, or what? Which values are changing each year and on what basis are they changing? What do you want to calculate in code?

3. ## Re: Values entere via form (Acc2K)

Thank you Charlotte, as this is exactly what I will be doing. Most of these are payroll, health, FICA, etc. I just need a jumpstart on ideas as to how to allow a user to update the values, then I can write some functions or procedures to accomplish this.
Each teacher earns a salary based on their degree and number of years at the district. Most of the calculations are based on their gross pay, but they change from fiscal year to fiscal year(July 1 to June 30).
I need to go through all the records, update their years ( referred to a step ) adding one each year to a maximum of 18, then calculate the FICA, Health, etc. according to a schedule that is published by the teachers' contract. The schedule lists 3 items: The degree, Number of Years (Step), and the Salary.

Thank you so much for the reply and any ideas....

4. ## Re: Values entere via form (Acc2K)

Allan,
Your algorithm as far as I can see, is exactly what you wrote in your post: cycle through records, updating # number to max of 18 and compute the FICA, Health, etc.

I would open a recordset and loop to EOF, calling sub-routines or functions to do calculations on each record.
Gwenda

5. ## Re: Values entere via form (Acc2K)

Thanks, Gwenda. The only item I'm fuzzy on would be how to construct a table to hold the multipliers, etc. So many times I see people recommending NOT to use DLookup, and am curious as to any other method of finding these values....
I would use this if necessary. Just wondering if there is a better way.

6. ## Re: Values entere via form (Acc2K)

Hi Allan,
I would create a new table with one record in it to hold your multipliers. Then begin your "run" through the database by opening the table with your values and reading them into memory variables and then closing the table and then do the rest of your processing by referencing the memory variables.

Maybe Charlotte or other lumineries will have a different approach.
Gwenda

7. ## Re: Values entere via form (Acc2K)

Another way to do it? There are probably dozens of ways to do it.

One I use a lot is to create a series of public functions, one for each "constant" value you might look up in your table (by the way, I use a table with multiple records, but only two fields, ConstName and ConstValue. I create a record for each "constant" I was to retrieve, and this way it's open-ended). Each function has a static variable in it, and it only does a DLookup if the variable is empty. Otherwise, it just returns the value of the static variable. It is not as breakable as global variable, and will fix itself if it breaks. Global variables break whenever you encounter an unhandled error in your application. Plus, you can call it in queries or wherever, which is not true of a variable.

8. ## Re: Values entere via form (Acc2K)

As always, Charlotte, a word from you is worth a whole day of reading technical books.
Thanks,
GWenda

9. ## Re: Values entere via form (Acc2K)

My day is now a lot brighter since receiving your reply. It is very refreshing to have some other ideas, especially when given in a such an unselfish spirit.

So much to learn - people here make it possible.
Thanks to all!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•