none
MS Access 2013 Error - Null value- RRS feed

  • Question

  • I keep getting the following message: 'You tried to assign the Null value to a variable that is not a Variant data type."  I have read some of the online answers, some of them mention forms, but I don't have a form associated with it.   It's a query to append data from in a table in Access to a library/database file on an IBM iSeries.  It is set up on the Linked Table Manager.  Some of the queries work, some don't.  I don't have any nulls in the table. Here is a typical SQL code:

    INSERT INTO TESTLIB_FILE1 ( MORTCD, MTGNAM, MTGSTR, MTGSTR2, MTGCTY, MTGST, MTGZIP, MTGDASH, MTGZIP4 )
    SELECT FILE1.MORTCD, FILE1.MTGNAM, FILE1.MTGSTR, FILE1.MTGSTR2, FILE1.MTGCTY, FILE1.MTGST, FILE1.MTGZIP, FILE1.MTGDASH, FILE1.MTGZIP4
    FROM FILE1.

    Also, If I manually enter data in directly into the table or the database file, it does replicate to the other side.

    Thanks for any help.
    Tuesday, August 11, 2015 6:29 PM

All replies

  • I keep getting the following message: 'You tried to assign the Null value to a variable that is not a Variant data type."  I have read some of the online answers, some of them mention forms, but I don't have a form associated with it.   It's a query to append data from in a table in Access to a library/database file on an IBM iSeries.  It is set up on the Linked Table Manager.  Some of the queries work, some don't.  I don't have any nulls in the table. Here is a typical SQL code:

    INSERT INTO TESTLIB_FILE1 ( MORTCD, MTGNAM, MTGSTR, MTGSTR2, MTGCTY, MTGST, MTGZIP, MTGDASH, MTGZIP4 )
    SELECT FILE1.MORTCD, FILE1.MTGNAM, FILE1.MTGSTR, FILE1.MTGSTR2, FILE1.MTGCTY, FILE1.MTGST, FILE1.MTGZIP, FILE1.MTGDASH, FILE1.MTGZIP4
    FROM FILE1.

    Also, If I manually enter data in directly into the table or the database file, it does replicate to the other side.

    Thanks for any help.

    The error message looks like one that comes from VBA.  Are you executing this query from VBA?  If so, could you please post the code of the procedure where the error is raised -- and, preferably, indicate the line that raises the error?


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Tuesday, August 11, 2015 7:49 PM
  • I agree with Dirk, this is a VBA error. What if you create a query with this SQL and run it interactively?

    -Tom. Microsoft Access MVP

    Wednesday, August 12, 2015 2:56 AM