that was it !!!!
Dear smart,
Your problem is that you left stDocname empty !!!!
here is the code.
Private Sub scrStudent_AfterUpdate()
On Error GoTo Err_AftUpdate
Dim stDocName As String
Dim absencelogged As String
absencelogged = Nz(DLookup("[Name]", "[Qry_Preview_Current_Absence]"), "")...