Inserting NULL values in a database from VBA code

后端 未结 2 1089
我在风中等你
我在风中等你 2020-12-06 14:39

I have 3 radioButtons (\"YES\", \"NO\", \"UNKNOWN\") wich matches a column from my database with 3 possible values (1, 0, NULL).

When the radioButton selected is \"

2条回答
  •  盖世英雄少女心
    2020-12-06 14:46

    Just an idea for the future - whenever you are having a problem with big SQL code like this:

    sqlQuery = "UPDATE candidatures SET offre_ID = " & idO & ", candidat_Nom = " & more and more more SQL here";"

    Do the following:

    1. Write debug.print sqlQuery after the code.
    2. Take the result from the immediate window and inspect it.
    3. Copy it and take it into Access query. It should work. If it does not - inspect and debug further.

    Edit: If you have the time & the knowledge & the will to write good code, do not write code like this. You may suffer from SQL injection and other problems. Instead use the method from the answer of Mat's Mug.

提交回复
热议问题