Need to INSERT blank field into my database from Excel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • evilbungle
    New Member
    • Apr 2008
    • 26

    Need to INSERT blank field into my database from Excel

    Hi, I am sure this should be easy but can't get it working,

    I have a database which needs to import fields from a spreadsheet, I can open the spreadsheet and load the fields I want to into an INSERT INTO statement. I had an issue with a previous INSERT INTO and solved it using the NULL keyword (rather than just leaving it blank) which now works fine.

    Where I get stuck is in loading up a blank value, if the field is blank in Excel it throws up an error, problem is I can't use ISNULL() or Nz() as the value is Blank and not Null.
    Is there anything tike Nz that can change it from a blank field, I have tried
    Code:
    iif(.Range("A1").value = " ","Null",.Range("A1").value)
    but it does not pick it up,

    Any help you can give would be greatly appreciated as I have been stuck on this for a while.

    I am using Access/Excel 03
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    #2
    The way you've written the condition in the IIf function, you are looking for " " which is an entry with one space. Are you sure you aren't looking for a zero-length string, "" ?

    Pat

    Comment

    Working...