Hello,
If multiple insert statements exist, write out separate insert statements, and do: Connection.Execute(strSQL)
TO ignore the empty fields, either provide null for that field, or only insert the fields into the SQL string that exist, which you can do something like:
if ( txt5 <> "" ) then
strParamSQL = strParamSQL & "Value, "
strValueSQL = strValueSQL & "'" & txt5.text & "', "
end if
That way the values that exist only get's inserted. At the end, strip of the last ", " because that will cause problems, and call the execute method for the SQL as such:
Connection.Execute("insert into tblPostCode (" & strParamSQL & ") values (" & strValueSQL & ")"
I hope this is what you were looking for...
Brian
|