which OnEvent to use?

ellenr

Registered User.
Local time
Today, 11:09
Joined
Apr 15, 2011
Messages
400
Access 2010. I am in a subform to verify previously entered data (payroll timecard--making a change to a long-ago .mdb). The data to be entered is total hours to be paid, and "A" for absent beside date for each day of week in question. If an "A" is entered into a control, I want to verify it against the previously entered data. If the data entry person leaves that control without it matching the previously entered amount, I want to change the original amount's control to visible. I will then let the data entry person click the one that is correct. The problem: once data is entered (matching or not), control passes to the next day's record before I can compare the verification entry to the original. I have tried dirty, before and after update, exit, change and lost focus--none of which work. This shouldn't be this hard! What am I missing?

Thanks
 
You are addressing the wrong issue.

The need to choose the correct data from conflicting alternatives indicates a normalization error. A properly normalized database is fundamentally incapable of accepting conflicting data.
 
There are two text fields for absence in the time table: aVerify and aEntry. The aEntry field is entered when the timecards are entered originally. In the verify screen, aVerify field is entered. After the value or lack thereof is entered, I wish to compare it to the original aEntry field and if different do something to let the entry person know there is a problem needing correction. I just don't know how to capture it before leaving the record.
 
Form_BeforeUpdate fires before any changed record (including new) is updated.
 
If no update is needed, ie they just hit enter to pass through an empty control (when in fact the original had an "A" entered), will it catch the difference. I wouldn't think it would need to update anything so it wouldn't do the compare?
 
Form_BeforeUpdate refers to the entire record. Any change to any value in the record will fire it before leaving. If the event needs to fire when there has been no change then use the Form_Current event.

However if this is simply a checking process for existing completed records then I would use a query to get only the records where a conflict exists.
 
Thank you to the many who have weighed in! After meeting with client I have changed my approach somewhat. Now to my current problem: my subform's field [a] <> [Absent] (see attached file). However, "if [a]<>[Absent]" never computes as true (macro attached). How do I determine if the two are different so I can make [Absent] visible? This is in the on Exit event, although I have tried it in others. I must be missing something obvious. :banghead:
 

Attachments

  • macro.PNG
    macro.PNG
    2.8 KB · Views: 102
  • query.PNG
    query.PNG
    10.3 KB · Views: 83
So you keep track of hours AND absent? Can't we calculate that if the sum of hours for a day is zero, then absent is true? And if we can calculate that, why do we store it?
 
The reason? Because the client wants it. They manufacture cushions for the furniture industry and have a complicated scheme for employee compensation. They have time-only workers, piece workers, combinations thereof, home sewers, truck drivers. Most, but not all, get paid for holidays, hence get 8 hrs. that didn't get punched in on the time card, but some do not. Anyway, my role is not to question the decision, but to do it. My only problem is in the verification screen--they enter the time card data once, then reenter it on the verification screen. If that inputted amount doesn't match the previously entered data, a field becomes visible containing the original amount and then they get to choose the correct amount. I just can't get it to work!
 

Users who are viewing this thread

Back
Top Bottom