Results 1 to 20 of 21

Thread: Instruction end

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Site Admin VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,496
    Location
    Does this work for you?

    If the values SongNaam, Bank.Value, Deel.Value, and Locatie.Value are all text fields (requiring single quotes around their values in the SQL string), the corrected code should look something like this:

    CurrentDb.Execute "UPDATE tblRegister SET SongNaam = '" & SongNaam & "', " & _
        "Bank = '" & Bank.Value & "', " & "Deel ='" & Deel.Value & "', " & "Locatie = '" & Locatie.Value & "'"
    However if the values Bank, Deel, or Locatie are numeric fields in the tblRegister table, they should not have single quotes around their values in the SQL string. For example, if Locatie is a number:


    CurrentDb.Execute "UPDATE tblRegister SET SongNaam = '" & SongNaam & "', " & _
        "Bank = '" & Bank.Value & "', " & "Deel = '" & Deel.Value & "', " & "Locatie = " & Locatie.Value
    Last edited by Aussiebear; 06-23-2025 at 12:50 PM. Reason: Added further information for clarity
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •