I am using MS Access as back end and inserting the values that are in excel trying to handle empty spaces.
sSQL = "Insert into " & Cells(1, 1) & " VALUES ( '" & CStr(Cells(r, 53)) & "',' " & CStr(Cells(r, 54)) & "', '" & IIF(Isnull(Cells(r,55), "NULL",Cint(Cells(r,55)) & "',' " & CInt(Cells(r, 56)) & "',' " & CInt(Cells(r, 57)) & "',' " & CInt(Cells(r, 58)) & "','" & CInt(Cells(r, 59)) & "',' " & CInt(Cells(r, 60)) & "',' " & CInt(Cells(r, 61)) & "')"
For the IIF(Isnull(Cells(r,55), "NULL",Cint(Cells(r,55)) if the cell is empty it should return NULL in the query but it is while running the query is not displaying NULL in it.
Insert into Test VALUES ( 'MODULE:',' Test','' ,' 0',' 0',' 0','0',' 0',' 0')
How can I get NULL over there. Macro is throwing an error while inserting coz there is no value for that.