I have Insert statement that inserts records from one table to another. SQL works, but not If field in WHERE clause is Null. No errors, just nothing gets inserted. How can I fix this ? This is what I have (fields are named same in both tables - Me.[Serial_No] represents bound field - textbox :
dim SQL as String
SQL = "INSERT INTO Table1 (Serial_No,Name,Description)" & _
"SELECT Table2.Serial_No, Table2.Name, Table2.Description" & _
" FROM Table2" & _
" WHERE Table2.Serial_No='" & Me.[Serial_No] & "'"
DoCmd.RunSQL SQL
serial_nofield is null, or empty, then you are not selecting any records to be inserted in totable1