View Single Post
  #1 (permalink)  
Old July 31st, 2006, 07:23 AM
barteksollie barteksollie is offline
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Visual basic update query

Private Sub CmdSaveRecord_Click()
    Dim strSql As String
    Dim StrKamer_nr As String, StrKamer_datum As String, StrKamer_tijd As String
    Dim StrKamer_roosterdatum As String, StrKamer_begintijd As String, StrKamer_eindtijd As String
    Dim StrMedewerker_nr As String, StrAssistent_nr As String, StrKamer_goedgekeurd As String, StrKamer_omschrijving As String

strSql = "UPDATE Kamers SET Kamer_roosterdatum = " & Me.Kamer_roosterdatum & ", Kamer_begintijd = '" & Me.Kamer_begintijd & "', Kamer_eindtijd = '" & Me.Kamer_eindtijd & "', Medewerker_nr = '" & Me.TxTMedewerker_nr & "', Assistent_nr = '" & Me.TxTAssistent_nr & "', Kamer_goedgekeurd = '" & Me.Kamer_goedgekeurd & "', Kamer_omschrijving = '" & Me.Kamer_omschrijving & "' WHERE Kamer_nr = '" & Me.Kamer_nr & "';"

strSql = "UPDATE Kamers SET Kamer_nr = StrKamer_nr, Kamer_roosterdatum = StrKamer_roosterdatum, Kamer_begintijd = StrKamer_begintijd, Kamer_eindtijd = StrKamer_eindtijd, Medewerker_nr = StrMedewerker_nr, Assistent_nr = StrAssistent_nr, Kamer_goedgekeurd = StrKamer_goedgekeurd, Kamer_omschrijving = StrKamer_omschrijving WHERE Kamer_nr = StrKamer_nr;"

    DoCmd.SetWarnings False
    DoCmd.RunSQL strSql
    DoCmd.SetWarnings True
End Sub

What's wrong wit my update insert into query?
Could someone look at it and fix it or give me some advise me

Reply With Quote