G
Guest
..::I posted this in Forms Coding but I decided to try my luck here also::.
Okay... I am still working on this Employee Attendace database... In a case
where an employee goes on vacation, I had a update query that automatically
changes the attendance status for those days from "P" to "V" (the information
for the whole year is pre-entered so all employee status is defaulted to P
for "Present").
The update query would ask for the employees name, the start date of the
vacation and the end date of the vacation. It would then change the status
for those days to "V", and under the VACATION HOURS feild it would change
that value from 0 to 7, and it would change HOURS (hours spent on duty) to 0
(since it is defaulted to 7).
The user of the database however does not like the update query. I was
wondering if there was a way I could do this in a form. So far I have gotten
the query to pull up the records that I want to make the changes to. My
problem though is getting the form to update all the records at the same
time. For Example my form would pull up this information if she enters the
[EMPLOYEE NAME] as John Allen, [START DATE] as Jan 3 2005 and [END DATE] as
Jan 6 2005:
(main form)
*I have not placed anything here yet*
(sub form in datasheet view)
DATE NAME STATUS HOURS VACATION HOURS
1/3/2005 John Allen P 7
0
1/4/2005 John Allen P 7
0
1/5/2005 John Allen P 7
0
1/6/2005 John Allen P 7
0
How would I get the form to change that information to the following when
she clicks a button:
(main form)
*I have not placed anything here yet*
DATE NAME STATUS HOURS VACATION HOURS
1/3/2005 John Allen V 0 7
1/4/2005 John Allen V 0 7
1/5/2005 John Allen V 0 7
1/6/2005 John Allen V 0 7
I would aslo want to know how to display the two dates that she entered to
be placed in the form. In other words I want the form to look like this
after she enters the information:
(mainform)
Employee Name: John Allen
Vacation Start Date: Jan 3 2005
Vacation End Date: Jan 6 2005
(datasheet subform)
DATE STATUS HOURS VACATION HOURS
1/3/2005 P 7 0
1/4/2005 P 7 0
1/5/2005 P 7 0
1/6/2005 P 7 0
(Buttons)
[Update Records] [Close Form]
--------
And then when she clicks [UPDATE RECORDS] for the subform to change to this:
(mainform)
Employee Name: John Allen
Vacation Start Date: Jan 3 2005
Vacation End Date: Jan 6 2005
(datasheet subform)
DATE STATUS HOURS VACATION HOURS
1/3/2005 V 0 7
1/4/2005 V 0 7
1/5/2005 V 0 7
1/6/2005 V 0 7
(Buttons)
[Update Records] [Close Form]
Okay... I am still working on this Employee Attendace database... In a case
where an employee goes on vacation, I had a update query that automatically
changes the attendance status for those days from "P" to "V" (the information
for the whole year is pre-entered so all employee status is defaulted to P
for "Present").
The update query would ask for the employees name, the start date of the
vacation and the end date of the vacation. It would then change the status
for those days to "V", and under the VACATION HOURS feild it would change
that value from 0 to 7, and it would change HOURS (hours spent on duty) to 0
(since it is defaulted to 7).
The user of the database however does not like the update query. I was
wondering if there was a way I could do this in a form. So far I have gotten
the query to pull up the records that I want to make the changes to. My
problem though is getting the form to update all the records at the same
time. For Example my form would pull up this information if she enters the
[EMPLOYEE NAME] as John Allen, [START DATE] as Jan 3 2005 and [END DATE] as
Jan 6 2005:
(main form)
*I have not placed anything here yet*
(sub form in datasheet view)
DATE NAME STATUS HOURS VACATION HOURS
1/3/2005 John Allen P 7
0
1/4/2005 John Allen P 7
0
1/5/2005 John Allen P 7
0
1/6/2005 John Allen P 7
0
How would I get the form to change that information to the following when
she clicks a button:
(main form)
*I have not placed anything here yet*
DATE NAME STATUS HOURS VACATION HOURS
1/3/2005 John Allen V 0 7
1/4/2005 John Allen V 0 7
1/5/2005 John Allen V 0 7
1/6/2005 John Allen V 0 7
I would aslo want to know how to display the two dates that she entered to
be placed in the form. In other words I want the form to look like this
after she enters the information:
(mainform)
Employee Name: John Allen
Vacation Start Date: Jan 3 2005
Vacation End Date: Jan 6 2005
(datasheet subform)
DATE STATUS HOURS VACATION HOURS
1/3/2005 P 7 0
1/4/2005 P 7 0
1/5/2005 P 7 0
1/6/2005 P 7 0
(Buttons)
[Update Records] [Close Form]
--------
And then when she clicks [UPDATE RECORDS] for the subform to change to this:
(mainform)
Employee Name: John Allen
Vacation Start Date: Jan 3 2005
Vacation End Date: Jan 6 2005
(datasheet subform)
DATE STATUS HOURS VACATION HOURS
1/3/2005 V 0 7
1/4/2005 V 0 7
1/5/2005 V 0 7
1/6/2005 V 0 7
(Buttons)
[Update Records] [Close Form]