Inserting a null value into a database

  • Good morning,

    Hope someone can help me out.

    I am trying to insert values into a access table.

    The spreadsheet where I am taking values from does contain blank cells. This is throwing out my code to insert the values into my table.

    This is my code.

    What do I need to do to enable inserting of null values?

    I have tried using Nz() but doesn't seem to work

    Name = Nz(Range("E" & b).Value, 0)

    Thanks for your help!

  • Re: Inserting a null value into a database

    Hi Shark,

    The spreadsheet is emailed to me on a weekly basis. I need the information in the database so I can pull a number of different queries.

    I am trying to automate this so I can create an add-in so anyone in my team will easily be able update our database.

  • Re: Inserting a null value into a database


    My questions still stand.

    Have you actually tried linking to the workbook and running a normal query? If this works then all you will have to do is save the new file with a standard name in a specific location and then open the database. This will be very easy to automate.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!