annedelina
February 4th, 2000, 12:14 PM
Please help. I have attached my code. When I reach the end of a recordset and am about to add a new reocrd. I get an exception error that boots me out of access all together.
please help. This project is laready past deadline and i have to finish it bfore the middle of March.
thanks.
Anne Johnson
'Final Paryoll Docuemtnation
'This is the labor file update subform that is giving me problems.
option Compare Database
option Explicit
'This is a test to see if i can calculate without causing an illegal page fault.
private Sub Elaptime_KeyPress(KeyAscii as Integer)
MsgBox ("Calculating Elaptime.")
me.Elaptime = me.Endtime - me.Begtime
End Sub
private Sub Form_AfterUpdate()
on error GoTo Form_AfterUpdate_Err
DoCmd.GoToRecord , "", acNewRec
Form_AfterUpdate_Exit:
Exit Sub
Form_AfterUpdate_Err:
MsgBox error$
resume Form_AfterUpdate_Exit
End Sub
private Sub Form_Open(Cancel as Integer)
on error GoTo Form_Open_Err
DoCmd.GoToRecord , "", acNewRec
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox error$
resume Form_Open_Exit
End Sub
private Sub Date_KeyPress(KeyAscii as Integer)
[Employee Labor Update]![date].OldValue
End Sub
'this is to see if anything has changed.
private Sub Form_Timer()
Dim fDirty as Boolean
fDirty = me.Dirty
With me!Elaptime
If Not (fDirty Eqv .Visible) then .Visible = fDirty
End With
End Sub
'private Sub Over20_Change()
'This is to see if the employee is working over 20
'MsgBox ("Here")
'DateAdd(1, 7, me.date) = me.TotalHours
''Dim weeklyhours as Integer
''weeklyhours = DSum("TotalHours", "Elaptime", me.Endtime - me.Begtime)
'If (me.Elaptime > 20) then
' DoCmd.Beep
' MsgBox ("This Employee is working Over 20.")
' me.Over20 = me.tbSumHours - 20
'End If
'End Sub
private Sub Over20_KeyPress(KeyAscii as Integer)
MsgBox ("Here")
DateAdd(1, 7, me.date) = me.Totalhours
''Dim weeklyhours as Integer
''weeklyhours = DSum("TotalHours", "Elaptime", me.Endtime - me.Begtime)
If (me.Elaptime > 20) then
DoCmd.Beep
MsgBox ("This Employee is working Over 20.")
me.Over20 = me.tbSumHours - 20
End If
End Sub
'private Sub Overtime_Change()
'This is a test to see if the employee has worked over 40 hours in a single week.
'MsgBox ("Here")
'If (me.Elaptime > 40) then
' DoCmd.Beep
' MsgBox ("This Employee has worked Overtime.")
' me.Overtime = me.tbSumHours - 40
'End If
'End Sub
private Sub Overtime_KeyPress(KeyAscii as Integer)
MsgBox ("Here")
If (me.Elaptime > 40) then
DoCmd.Beep
MsgBox ("This Employee has worked Overtime.")
me.Overtime = me.tbSumHours - 40
End If
End Sub
private Sub tbSumHours_KeyPress(KeyAscii as Integer)
MsgBox ("I'm Here.....")
Sum (me.Elaptime)
End Sub
private Sub TotalHours_AfterUpdate()
MsgBox ("TotalHours are being calculated.")
Sum (me.Elaptime)
End Sub
please help. This project is laready past deadline and i have to finish it bfore the middle of March.
thanks.
Anne Johnson
'Final Paryoll Docuemtnation
'This is the labor file update subform that is giving me problems.
option Compare Database
option Explicit
'This is a test to see if i can calculate without causing an illegal page fault.
private Sub Elaptime_KeyPress(KeyAscii as Integer)
MsgBox ("Calculating Elaptime.")
me.Elaptime = me.Endtime - me.Begtime
End Sub
private Sub Form_AfterUpdate()
on error GoTo Form_AfterUpdate_Err
DoCmd.GoToRecord , "", acNewRec
Form_AfterUpdate_Exit:
Exit Sub
Form_AfterUpdate_Err:
MsgBox error$
resume Form_AfterUpdate_Exit
End Sub
private Sub Form_Open(Cancel as Integer)
on error GoTo Form_Open_Err
DoCmd.GoToRecord , "", acNewRec
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox error$
resume Form_Open_Exit
End Sub
private Sub Date_KeyPress(KeyAscii as Integer)
[Employee Labor Update]![date].OldValue
End Sub
'this is to see if anything has changed.
private Sub Form_Timer()
Dim fDirty as Boolean
fDirty = me.Dirty
With me!Elaptime
If Not (fDirty Eqv .Visible) then .Visible = fDirty
End With
End Sub
'private Sub Over20_Change()
'This is to see if the employee is working over 20
'MsgBox ("Here")
'DateAdd(1, 7, me.date) = me.TotalHours
''Dim weeklyhours as Integer
''weeklyhours = DSum("TotalHours", "Elaptime", me.Endtime - me.Begtime)
'If (me.Elaptime > 20) then
' DoCmd.Beep
' MsgBox ("This Employee is working Over 20.")
' me.Over20 = me.tbSumHours - 20
'End If
'End Sub
private Sub Over20_KeyPress(KeyAscii as Integer)
MsgBox ("Here")
DateAdd(1, 7, me.date) = me.Totalhours
''Dim weeklyhours as Integer
''weeklyhours = DSum("TotalHours", "Elaptime", me.Endtime - me.Begtime)
If (me.Elaptime > 20) then
DoCmd.Beep
MsgBox ("This Employee is working Over 20.")
me.Over20 = me.tbSumHours - 20
End If
End Sub
'private Sub Overtime_Change()
'This is a test to see if the employee has worked over 40 hours in a single week.
'MsgBox ("Here")
'If (me.Elaptime > 40) then
' DoCmd.Beep
' MsgBox ("This Employee has worked Overtime.")
' me.Overtime = me.tbSumHours - 40
'End If
'End Sub
private Sub Overtime_KeyPress(KeyAscii as Integer)
MsgBox ("Here")
If (me.Elaptime > 40) then
DoCmd.Beep
MsgBox ("This Employee has worked Overtime.")
me.Overtime = me.tbSumHours - 40
End If
End Sub
private Sub tbSumHours_KeyPress(KeyAscii as Integer)
MsgBox ("I'm Here.....")
Sum (me.Elaptime)
End Sub
private Sub TotalHours_AfterUpdate()
MsgBox ("TotalHours are being calculated.")
Sum (me.Elaptime)
End Sub