T
tkraju via OfficeKB.com
Hellow Vba experts,
Through a Userform data(4 fields) is to be entered into my W/sheet.The
W/sheet has 4 columns - Col A - "Employee Id",Col B-"Date",Col C-"Time In"
and Col D-"Time Out"
In my Userform I have 4 Textboxes,2 Labels,3 Command buttons.The lay out
order is:
Label1--Enter your Id
Textbox1--for Employee id entry
CommandButton1--"Confirm"
Textbox2,3,4 -- for Employee id,Time in,Time out display.
Commandbutton 2--"In" or "Out"
Condbuttonbutton3--"Close".
I need a proper code for Userform--Whenever an employee enters his id in
Textbox1 and press "Confirm" button,the code should verify from W/sheet ,what
action needed,whether he will "in" or "out",whether any "in time" record for
current date is there or not for the id entered and accordingly "In" or "Out"
button be activated i.e the button name/label be changed accordingly.
After pressing "in" or "out" button the data should update in w/sheet's
employee id,date,in time or out time.
Suppose employee came to work( "in time") at 10:00 PM yesterday and ends his
job today at 6:00AM(Time Out),when enters his id today,the "Out" button
should populate.
Output needed:-When "In" button pressed,W/sheet's last row be updated as:
Col A------------Col B------------Col C------------Col D
EmployeeId--- Date-----------Time In ---------- Time Out
105914 --- 04/01/2009 --- 06:00 AM -----
and on userform
Textbox2 and 3 be displayed Emploee Id and Time In.
When "Out" button pressed
Col A------------Col B------------Col C------------Col D
EmployeeId--- Date-----------Time In ---------- Time Out
105914 --- 04/01/2009 --- 06:00 AM ----- 02:10 PM
and on userform
Textbox2 and 3 be displayed Emploee Id and Time In and Time Out.
Note: In one day one Time In and one Time Out entry validation necessary.
Through a Userform data(4 fields) is to be entered into my W/sheet.The
W/sheet has 4 columns - Col A - "Employee Id",Col B-"Date",Col C-"Time In"
and Col D-"Time Out"
In my Userform I have 4 Textboxes,2 Labels,3 Command buttons.The lay out
order is:
Label1--Enter your Id
Textbox1--for Employee id entry
CommandButton1--"Confirm"
Textbox2,3,4 -- for Employee id,Time in,Time out display.
Commandbutton 2--"In" or "Out"
Condbuttonbutton3--"Close".
I need a proper code for Userform--Whenever an employee enters his id in
Textbox1 and press "Confirm" button,the code should verify from W/sheet ,what
action needed,whether he will "in" or "out",whether any "in time" record for
current date is there or not for the id entered and accordingly "In" or "Out"
button be activated i.e the button name/label be changed accordingly.
After pressing "in" or "out" button the data should update in w/sheet's
employee id,date,in time or out time.
Suppose employee came to work( "in time") at 10:00 PM yesterday and ends his
job today at 6:00AM(Time Out),when enters his id today,the "Out" button
should populate.
Output needed:-When "In" button pressed,W/sheet's last row be updated as:
Col A------------Col B------------Col C------------Col D
EmployeeId--- Date-----------Time In ---------- Time Out
105914 --- 04/01/2009 --- 06:00 AM -----
and on userform
Textbox2 and 3 be displayed Emploee Id and Time In.
When "Out" button pressed
Col A------------Col B------------Col C------------Col D
EmployeeId--- Date-----------Time In ---------- Time Out
105914 --- 04/01/2009 --- 06:00 AM ----- 02:10 PM
and on userform
Textbox2 and 3 be displayed Emploee Id and Time In and Time Out.
Note: In one day one Time In and one Time Out entry validation necessary.