VBA for Payroll form

djossh

Registered User.
Local time
Today, 20:11
Joined
Oct 19, 2011
Messages
89
Hi, I need a code for my Forms.. I dont know if this is possible.. Im a newbie in access please help..

I have a form (PayrollForm) with multiple sets of fields...what I want to do is.. after entering all the data in the first set of record.. it shoul be save to my table (PayrollTable)... then Retains its value just for the user to see what's he entered.. then Focus on the next sets of fields (2nd Row or 2nd Record) the do the same action.. same as 3rd, 4th and 5th rows..

Please see attached format of my payroll form.. Thanks..
 

Attachments

  • Payroll.jpg
    Payroll.jpg
    59.7 KB · Views: 201
You can do what you want by placing the daily record entries in a subform within the main form. You don't really need VBA in this context because the mechanism is built-in to the subform to show current records. The form contained in the subform control should be in continuous view mode in order to see the daily rows at the same time.
 
You can do what you want by placing the daily record entries in a subform within the main form. You don't really need VBA in this context because the mechanism is built-in to the subform to show current records. The form contained in the subform control should be in continuous view mode in order to see the daily rows at the same time.

Thanks for your reply. Yes you are right, I can have same results using subform. but the reason I am trying to do it based on my format is to save time in encoding all those details again. It is actually a monthly basis (30 days data) Im just showing 5 rows in my sample. Most of the Details in Overtime are almost the same. sometimes all I need to change is the employee number and a couple of projects & a few in overtime.. Im encoding 300 plus employee's timesheet. that will speed up my job.. any suggestions?? Thanks..
 
Looking at your Payroll Entry Form, it appears that the bottom part of the form represents a subform (from MEP Number down). However, it looks as if you have entered the rows individually (judging by the alignments)?
I suggest you create the subform with the variable fields contained in it (Project, Days, Hours [x3]). In the main form, put unbound controls to represent the same fields as the subform (say cmbProject, txbDays, txbStandard, txbOvertime & txbHolidays).
Add a command button (say cmdAdd), whose click event transfers the values of the unbound controls to a new record in the subform fields.
Then, whenever you create the first record for the month for each employee, populate the unbound records with their starting values (from the Current event of the main form) and adjust them manually as necessary between successive clicks of the cmdAdd button. Because these controls are unbound, you can leave the values in situ between cycles, perhaps updating the day number as part of the cmdAdd event code.
Clearly there needs to be some validation on the fields as you go, to ensure their values are reasonable within context. You also need to prevent double-updating (which you can probably do by checking the day number + project code is not repeated in the table for the employee).
If you need help with any of this, let me know and be specific on the areas for which you need guidance.
 

Users who are viewing this thread

Back
Top Bottom