Hello All,
I have a database where the user enters the hours an employee had worked that week. The number is later used to figure if an employee gets an overtime commission and if so how much. ( a bunch of Chinese arithmetic the IRS dreamed up). Commission changes every quarter hour, so at 40.25 hours its .003 percent, at 40.50 hours its .006 percent…so on and so forth.
The user knows that they are supposed to put the hours in quarter increments, however I want to be sure because the lookup table will not give a correct commission if they are not.
I have tried to validate the number put in by putting in some code on the BeforeUpdate looking like this:
Dim Hours As Integer
If Hours < 40.24 Then Hours = 40
If Hours < 40.49 Then Hours = 40.25
~snip~
If Hours < 60.74 Then Hours = 60.5
If Hours < 60.99 Then Hours = 60.75
I don’t get any error on this, in fact It doesn’t seem to do anything. What ever I enter stays put and is not changed.
Question 1, Am I approaching this correctly, using the right type of validation and at the right place.
Question 2, How in the world do I make it work!
Many thanks for any help.
Rick
I have a database where the user enters the hours an employee had worked that week. The number is later used to figure if an employee gets an overtime commission and if so how much. ( a bunch of Chinese arithmetic the IRS dreamed up). Commission changes every quarter hour, so at 40.25 hours its .003 percent, at 40.50 hours its .006 percent…so on and so forth.
The user knows that they are supposed to put the hours in quarter increments, however I want to be sure because the lookup table will not give a correct commission if they are not.
I have tried to validate the number put in by putting in some code on the BeforeUpdate looking like this:
Dim Hours As Integer
If Hours < 40.24 Then Hours = 40
If Hours < 40.49 Then Hours = 40.25
~snip~
If Hours < 60.74 Then Hours = 60.5
If Hours < 60.99 Then Hours = 60.75
I don’t get any error on this, in fact It doesn’t seem to do anything. What ever I enter stays put and is not changed.
Question 1, Am I approaching this correctly, using the right type of validation and at the right place.
Question 2, How in the world do I make it work!
Many thanks for any help.
Rick