G
Guest
I have this form which is bound to a table and shows the vacation days of an
employee.Whenever an employee vacation details is entered the form's controls
should be updated so I have this code which I used in the OnCurrent
event.These are the controls
Forward -no.of days left from previous year.(Not a calculated field.)
No.of Days Due- no.of days left for current year.(Not a calculated field.)
Balance -Total no. of days left.(Not a calculated field.)
With Me
If .Forward > .To_Be_Taken Then
.Forward = .Forward - .To_Be_Taken
Else:
If .Forward = 0 Then
.No_of_Days_Due = .No_of_Days_Due - .To_Be_Taken
.Balance = .No_of_Days_Due - .To_Be_Taken
Else:
If .Forward < .To_Be_Taken And .Forward > 0 Then
.Forward = 0
.No_of_Days_Due = .No_of_Days_Due - .To_Be_Taken - .Forward
.Balance = .No_of_Days_Due - .To_Be_Taken - .Forward
End If
End If
End If
End With
But the problem is that it doesnt work.Can anyone pls tell me what I am
doing wrong.
employee.Whenever an employee vacation details is entered the form's controls
should be updated so I have this code which I used in the OnCurrent
event.These are the controls
Forward -no.of days left from previous year.(Not a calculated field.)
No.of Days Due- no.of days left for current year.(Not a calculated field.)
Balance -Total no. of days left.(Not a calculated field.)
With Me
If .Forward > .To_Be_Taken Then
.Forward = .Forward - .To_Be_Taken
Else:
If .Forward = 0 Then
.No_of_Days_Due = .No_of_Days_Due - .To_Be_Taken
.Balance = .No_of_Days_Due - .To_Be_Taken
Else:
If .Forward < .To_Be_Taken And .Forward > 0 Then
.Forward = 0
.No_of_Days_Due = .No_of_Days_Due - .To_Be_Taken - .Forward
.Balance = .No_of_Days_Due - .To_Be_Taken - .Forward
End If
End If
End If
End With
But the problem is that it doesnt work.Can anyone pls tell me what I am
doing wrong.