I can't give you a definitive answer, just suggestions: carefully examine the data types of the columns in the Part Number
table, then compare them to the data types of the columns in the PartNumberX
table. Make sure the corresponding columns are compatible, if needed by converting the PartNumberX
table columns into appropriate data types using the built-in conversion functions, as shown below.
Also, don't rely on the column orders matching between source and destination table--always explicitly type out the column names, like so:
insert into [Part Number] (c1, c2, ..., cn)
select cint(c1), cdbl(c2), ..., cstr(cn)
from PartNumberX
Make sure that any columns in the Part Number
table that are non-null (i.e., do not allow null values) indeed do always get non-null values. If necessary by testing for and then handling null values:
insert into [Part Number] (c1, ...)
select cint(iif(c1 is null, 0, c1)), ...
from PartNumberX
Make sure the insert does not violate any referential integrity rules (relationships). You can visually examine relationships with the Database Tools > Relationships > Relationships command, then clicking Relationship Tools > Design > Relationships > All Relationships.
Finally, you don't have to run the insert query in VBA. You can just as easily run it to test it out in the Access query editor's SQL view. That will give you some more feedback on possible errors.