I wrote the code for an accounting program in access 2003 it worked fine until I tried to converted it to access 2010. I have 3 tables an expense table a payroll table and a receipt table all are brought up in one form, the problem occurs when I enter the Medicare or Social Security amounts in the payroll form. At this point it is suppose to combine the two and add them to the expense table at which point it crashes with Update without add/new. IN access 2003 with identical code no crash but in 2010 crashes everytime. Attempted to attach the app but file type not allowed. Instead posting offending code and attaching jpeg of form
Private Sub Social_Security_AfterUpdate()
Me![Net Pay] = Me![Net]
Refresh
Me![Rec_Check] = Me![Rec]
Forms![Input Week]![Field10].Requery
Forms![Input Week]![Field14].Requery
Forms![Input Week]![Text74].Requery
Forms![Input Week].Requery
'DoCmd GoToRecord , , A_NEXT
FindIt ("[Rec] = " & [Rec_Check])
If IsNull(Forms![Input Week]![Expense Detail].Form![Type]) Then
Forms![Input Week]![Expense Detail].Form![Description] = "Combined Social Security"
Forms![Input Week]![Expense Detail].Form![Type] = "Tax Soc Sec"
Forms![Input Week]![Expense Detail].Form![Amount] = Forms![Input Week]![Text74] 'Edit text74 remove combined AlsoQueries Update soc and update soc2
Forms![Input Week]![Expense Detail].Form![Amount] = Forms![Input Week]![Week Ending]
Forms![Input Week]![Expense Detail].Requery
Exit Sub
End If
If Forms![Input Week]![Expense Detail].Form![CheckSoc] <> "" Then
DoCmd.SetWarnings False
DoCmd.OpenQuery "Delete Soc"
DoCmd.OpenQuery "Update Soc"
DoCmd.SetWarnings True
Forms![Input Week]![Expense Detail].Requery
End If
If IsNull(Forms![Input Week]![Expense Detail].Form![CheckSoc]) Then
DoCmd.SetWarnings False
DoCmd.OpenQuery "Update Soc2"
DoCmd.SetWarnings True
Forms![Input Week]![Expense Detail].Requery
End If
DoCmd.GoToControl "Medicare"
End Sub