Code For Warning Message

O.V.Killer

Registered User.
Local time
Today, 13:49
Joined
Dec 27, 2008
Messages
13
I Have A Form For Employees Vacation

Include The Vacation ID & Employee file No. & Vacation Start Date & Vacation End Date & One Field to Show Me How Many Days Past After His Vacation Last Day

What I Need That Is : Code When Last Field Come More Than 1 Day Different
A Warning Message popUp & Tell Me That

How Can Help Me ?
 
You could use the forms On Open event to check the field to see if it is greater than one day. For example: If you have a textbox called "txb_datecheck" which calculates how many days difference from the current date to the last date of the employee's vacation then your code might look something like this:

Code:
Private Sub Form_Open(Cancel As Integer)

If Me.txb_datecheck.Value > 1 Then 
DoCmd.OpenForm "frm_Warning", acNormal
End If

End Sub

In this scenario you have already created a form called, "frm_Warning" that indicates the employees vacation ended more than 1 day ago.
 
Thanks You Very Much
Work Fine With Me

& I Need One more Thing....

In This Vacation Form I Have Check Box Called WORK
When I Check It It Means That The Employee Is Working
When I Remove It Mean It That He Is In Vacation
So What I Wnat Is : Code
After His Vacation Finnish & I Got The Warning Message Thanks To You ::)
I Go To The Form & Check The Check Box
The Datecheck Textbox Go To Zero
Can Do It ?
 

Users who are viewing this thread

Back
Top Bottom