update sql currentdb execute problem

meenctg

Learn24bd
Local time
Today, 23:09
Joined
May 8, 2012
Messages
133
my code is

Code:
Private Sub Command12_Click()
Dim SQL As String
If Me.From = DLookup("BkashAccount", "Accounts", "[BkashAccount]=""" & Me.From & """") Then
CurrentDb.Execute ("UPDATE Accounts " & _
                      "SET Accounts.AcBalance = ''" & Me.ToBal & " +  " & Me.AmountTransfer & "''" & _
                      "WHERE [BkashAccount] = '" & Me.To & "'")

CurrentDb.Execute ("UPDATE Accounts " & _
                      "SET Accounts.AcBalance = ''" & Me.FromBal & " + " & Me.AmountTransfer & "''" & _
                      "WHERE [BkashAccount] = '" & Me.From & "'")
End If

End Sub

It shows like this message. Please help me for fix this.
attachment.php
 

Attachments

  • error.jpg
    error.jpg
    15.6 KB · Views: 760
What about the below:
CurrentDb.Execute ("UPDATE Accounts SET Accounts.AcBalance = " & Me.ToBal + Me.AmountTransfer & " WHERE [BkashAccount] = '" & Me.To & "'")
CurrentDb.Execute ("UPDATE Accounts SET Accounts.AcBalance = " & Me.FromBal + Me.AmountTransfer & " WHERE [BkashAccount] = '" & Me.From & "'")
 

Users who are viewing this thread

Back
Top Bottom