Blank value in a field BOMBS my INSERT INTO statement

G

Guest

I've noticed when I double click a line in my listbox, that if one of the
fields has a blank value, my INSERT INTO statement bombs out when I
double-click that line. Why is that??? What do I do so that my INSERT INTO
works when one field on the line is blank/empty?

Here is my code re: the INSERT INTO that takes 12 fields from the list box
and puts them in a tbl

db.Execute "INSERT INTO [tblMissingChargesinCP] " &
"([OrderTextFileUniqueID],[Oracle#],[DOS],[KCIItem#],[ExpandedQty],[OrderType],[OracleID],[PatientFirstName],[PatientLastName],[ROE],[Account#],[ShippedQty])"
& "VALUES(" & ctl.ItemData(varItem) & ",'" & ctl.Column(1, varItem) & "','" &
ctl.Column(2, varItem) & "','" & ctl.Column(3, varItem) & "'," &
ctl.Column(4, varItem) & ",'" & ctl.Column(5, varItem) & "'," & ctl.Column(6,
varItem) & ",'" & ctl.Column(7, varItem) & "','" & ctl.Column(8, varItem) &
"'," & ctl.Column(9, varItem) & "," & ctl.Column(10, varItem) & "," &
ctl.Column(11, varItem) & ")"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top