I wrote this code. When I try to activate this sub I always get this problem "syntax error (missing operator) in query expression '2020-12-01'". It's something wrong with Date (data in Polish means date).
Could u help me to fix this ?? I just want to take "Kolejka", "stadion", "Data" from form and add to my table Rozgrywki. I also attached pictures of this error and picture of my form in access.
Runtime error "3075"
Dialog being composed
Public Sub Dodaj(Kolejka, stadion, Data, DA, DB, Optional wa = 0, Optional wb = 0)
If [wa] = "" Then wa = 0
If [wb] = "" Then wb = 0
DoCmd.SetWarnings False
dodaj_rozgrywka = "" & _
"INSERT INTO Rozgrywki ( IDStadionu, Data, Idkolejki)" & _
"SELECT " & stadion & " AS Wyr1, #" & Data & "# AS Wyr2;, " & Kolejka & " AS Wyr3;"
DoCmd.RunSQL (dodaj_rozgrywka)
;
afterWyr2
andWyr3
. – Paul T.#01/12/2020#
. That is based on examples found here. I'll also add the ms-access tag, might attract more users. – Paul T.