SQL query in access vba
I have problem with this UPDATE query , I have got message about syntax
error query. I think that this query is correct and I can't find what is
giving this error.
Link to error
Private Sub cmdModifyBook_Click() 'approves modifying books to the database
Dim str As String
Dim dbs As DAO.Database
Set dbs = CurrentDb()
'checks if the typed all the data of book
If (Me.txtModifyTitle.Value = "") Or (Me.txtModifyTitleWeb.Value = "") Or
(Me.txtModifyVerkaufpreis.Value = "") _
Or (Me.txtModifyThemengruppe.Value = "") Then
MsgBox "Nicht alle von Ihnen eingegebenen Daten"
Exit Sub
End If
str = " UPDATE Katalog " _
& "(Bezeichnung, BezeichnungWeb, Verkaufspreis, Themengruppe) SET " _
& "('" & Me.txtModifyTitle.Value & "', '" & Me.txtModifyTitleWeb.Value
& "', '" & Me.txtModifyVerkaufpreis.Value & "', '" &
Me.txtModifyThemengruppe.Value & "') WHERE ID_Buch =" &
Me.lblModifyID.Caption & ";"
dbs.Execute str, dbFailOnError
MsgBox "Das Buch wurde in der Datenbank geändert", vbInformation
dbs.Close
Set dbs = Nothing
End Sub
No comments:
Post a Comment