strSql = "INSERT INTO Masterinfo (Masternr, Masterkode, Målartype, Betegnelse, Fabrikat, Spenning, Pris, Fase) VALUES (" & Me.Masternr & ", " & "'" + Nz(Me.Masterkode, "Null") + "'" & ", '" & Me.Mtype & "', " & "'" + Nz(Me.Betegnelse, "") + "'" & ", " & "'" + Nz(Me.Fabrikat, "") + "'" & ", " & "'" + Me.Spenning + "'" & ", " & Me.Pris & ", " & "'" + Me.Fase + "'" & ");"
strSql = "INSERT INTO Masterinfo (Masternr, Masterkode, Målartype, Betegnelse, Fabrikat, Spenning, Pris, Fase) VALUES (" & Me.Masternr & ", Null, '" & Me.Mtype & "', Null, Null, Null, Null, Null);"
The first one doesnt work, the second one does.
I want to be able to not have any values in Me.Fabrikat and Me.Spenning and such.
If i want it to be optional, what do i do in the SQL-statement?
strSql = "INSERT INTO Masterinfo (Masternr, Masterkode, Målartype, Betegnelse, Fabrikat, Spenning, Pris, Fase) VALUES (" & Me.Masternr & ", Null, '" & Me.Mtype & "', Null, Null, Null, Null, Null);"
The first one doesnt work, the second one does.
I want to be able to not have any values in Me.Fabrikat and Me.Spenning and such.
If i want it to be optional, what do i do in the SQL-statement?