Append query getting null value error

G

Guest

Hi,

I am trying to append records from a local table to a SQL table. When I run
the query I get a message that reads:

“You tried to assign the Null value to a variable that is not a Variant data
type†(Error 3162)

Does anyone have a suggestion on how to solve this?

Thank you!

Trauton
 
V

Van T. Dinh

Does the Destination Table have Fields where Null value is not allowed?

If it does, you need to make sure you don't pass the Null value to this
Field in your Append Query.
 
G

Guest

Van,

Thank you!!! I tell you, I get better answers out of this great group of
people than through hours surfing the web. I spent a lot of time last night
on this and although I had a general idea of the issue, nothing I read
focused it the way you did.

I had created a local table out of a spreadsheet and of course every record
in the spreadsheet had information in all the required fields (no empty
records). After reading your post, I decided to go into the new local table
and search for null values in the required field, my jaw dropped when it
found 87 such records! Apparently you can import an Excel file and
unknowingly also import empty records into the table, which is surprising
because I don't see empty records in my spreadsheet. once I deleted them, the
append query worked just as planned. Hopefully this will help someone else
too.

Thanks again!

Trauton
 

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