User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 374,020 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,742 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser:
Views: 17700 | Replies: 1
Reply
Join Date: May 2006
Posts: 2
Reputation: Saundra is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Saundra Saundra is offline Offline
Newbie Poster

Help Access If, Then, Else statement - HELP!

  #1  
May 4th, 2006
I have put together a Human Resource database for your company. The HR manager wants me to setup the vacation time field to automatically adjuster it's self each time their vacation changes each year from their Hire Date. My fields are: Date_of_Hire and VTBeginningBalance. Each time their hire date comes around I need it to calculate and fill in the VTBeginningBalance field.
0-1 year no vacation on their 1st anniversary date they get 40 hours.
On their 2nd anniversary they get 80 hours.
And it doesn't change until they reach their 5th year anniversary. On their 5th anniversary they get 120 hours. I need help with the access code and also where to place the code. Do I place it in an event procedure under Date_of_Hire or VTBeginningBalance? I have been trying everything.

Can someone please help me out on this one.

Thank you!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Posts: 3
Reputation: yvs is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yvs yvs is offline Offline
Newbie Poster

Re: Access If, Then, Else statement - HELP!

  #2  
Jun 16th, 2006
Hi, Saundra,

Keeping vacation time with every employee's record does not sound a good idea, because it depends on the time an employee has been
with a company rather then on a particular employee record.
In your example, there will be a group of employees, who has worked for less than 1 year, a group of people who has worked
for 1-2 years, 2+ years and the rest with 5+ years service history.
Besides, if you keep vacation time with the employee record,
WHEN are you going to update the value?
You would not like to have a program running all the time for years
in order to catch the moment. Doing this at the point when you
actually want to check the values will do so every time you open
an employee's record (let's say), which does not make sense either.

I would suggest creating a separate table, which holds correct vacation time for every period, you described. Something like:

Period Vacation time
1 40
2 80
5 120

Then every time you open the employee record, your program will calculate the difference (in years) between the current date and the employee's start date and then return vacation time from the above table. I would do this on "greater then" basis starting from the maximum period.

I hope this helps.




So, your VTBeginningBalance will be a dynamically calculated value
rather then a physical database field.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS Access and FileMaker Pro Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 11:14 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC