SIO Accounting.zipHere is the database. Use Admin acount to log in with Admin as pasword
Just tried it and it ran with no errors in A2010 32-bit using form load event and the current db execute code I suggested
Tested with existing record and a new record
Perhaps an issue with 64-bit? Does the project compile without error?
Yes it compiles without error in vba. Is there any other places I need to check for compile error ?
No.
I'm on a tablet so can't check references. Can you post a screenshot of them
If not fixed by then, I'll try this in A2016 64-bit tomorrow
References? Not sure what you mean...so sorry or the "stupidity here fro my side
Would you mind pasting the exact code you used s I can make sure Ive got it like it is suppose to be please?
Okay, the ship has changed course a bit.
I moved the Dsum steps to the On Current Event and the SQL section to after insert event in the form. The code I used is :
DoCmd.RunSQL ("Update InvoiceT SET IBalance =" & Me.txtInvBalance & "Where [InvoiceID] =" & Me.InvoiceID & ";")
Now I do not get any error messages when I open t form but the sql does not copy the value of the textbox to the field in the table........
This code works for me - I've also just tested it successfully in A2016 64-bit - no errors & AFAIK it updates as intended
EDIT: modified to update current record only
Code:Private Sub Form_Load() Dim TmpInv As Double Dim TmpPmt As Double Dim TmpBalance As Double Dim sSQL As String TmpInv = InvTotal TmpPmt = Nz(DSum("Amount", "PaymentsT", "InvoiceID= " & Me.InvoiceID), 0) TmpBalance = TmpInv - TmpPmt Me.txtInvBalance = TmpBalance DoEvents CurrentDb.Execute "UPDATE InvoiceT SET InvoiceT.IBalance = " & Me.txtInvBalance & " WHERE InvoiceID = " & Me.InvoiceID, dbFailOnError End Sub
IT works perfectly now. Many Many Thanks, you are a champion Sir!!.