Hi Experts!
I'm trying to use an access form to change the existing prices with BE in SQL Server, I'm getting an error , what should I do?
VBA code I'm using below:
Error message attached on picture
I'm trying to use an access form to change the existing prices with BE in SQL Server, I'm getting an error , what should I do?
VBA code I'm using below:
Code:
Private Sub CheckStatus_Click()
Dim strSql As String
'make sure any unsaved changes are saved to avoid conflicts:
DoCmd.RunCommand (acCmdSaveRecord)
'build the update query SQL string:
strSql = "UPDATE [tblPricing]" _
& " SET [FinalStatus]=Not NZ([FinalStatus],0)"
'if the form has an active filter - include it:
If Me.Filter <> "" And Me.FilterOn = True Then
strSql = strSql & " WHERE " & Me.Filter
End If
'run the update query SQL string:
CurrentDb.Execute strSql
'refresh the form so that changes in the table "bubble-up" to the form:
Me.Refresh
exit_sub:
End Sub
Error message attached on picture