question

DaveBootsma-8518 avatar image
0 Votes"
DaveBootsma-8518 asked DaveBootsma-8518 answered

Conversion issue with access 2003 to access 2010

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 form118657-accounting-form.jpg

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


office-access-dev
accounting-form.jpg (205.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DaveBootsma-8518 avatar image
0 Votes"
DaveBootsma-8518 answered

Me.Net and Me.net pay are on the payroll subform but that is the subform the code is in. Net Pay is visible Net is not
wish their was a way I could upload ya the whole thing but the message board only allows uploading of pictures no zip files

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BobLarson-6601 avatar image
0 Votes"
BobLarson-6601 answered

It looks to me, and I could be wrong, that you are attempting to refer to a subform object and a main form object both with ME. Is that true? If not, where is Me![Net] as I only see Me![Net Pay] which appears to be on the subform.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DaveBootsma-8518 avatar image
0 Votes"
DaveBootsma-8518 answered

Crashes with update or add/new without edit

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thedbguy avatar image
0 Votes"
thedbguy answered

Crashes, as in, no error message at all?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DaveBootsma-8518 avatar image
0 Votes"
DaveBootsma-8518 answered

Yes it crashes when I hit the first line where netpay = net. Then I remmed that out and it crashes at the next line. The thing that bugs me the most is as long as I run it in access 2003 there is no problem. I wonder if it has anything to do with the 2003 addin utility.mda. tried adding that to access 2010 but to no avail

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thedbguy avatar image
0 Votes"
thedbguy answered

Hi. Have you tried stepping through your code to see if you can catch the offending line?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.