INSERT INTO

  • Thread starter Thread starter dhstein
  • Start date Start date
D

dhstein

In this code below:

DoCmd.RunSQL "DELETE * FROM tblCostChanges;"

DoCmd.RunSQL "INSERT INTO tblCostChanges SELECT * FROM qryCostChanges;"


Do the fields have to be identical in the query and the table? Same names ?
Same datatypes ? Same sizes? Thanks for any help on this.
 
dhstein said:
In this code below:

DoCmd.RunSQL "DELETE * FROM tblCostChanges;"

DoCmd.RunSQL "INSERT INTO tblCostChanges SELECT * FROM qryCostChanges;"


Do the fields have to be identical in the query and the table? Same names
?
Same datatypes ? Same sizes? Thanks for any help on this.

The number of fields must be the same. The names don't matter, but by
position they must have the same data type. Size only matters if you might
be attempting to put too large a value (in other words, if field 4 in
qryCostChanges is too big to fit in field 4 of tblCostChanges)
 

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

Back
Top