Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select * not copying all records

Status
Not open for further replies.

EckyThump

MIS
May 15, 2007
33
0
0
GB
I have two tables one of which is a holding table for the other.

I am using the code:
Code:
strsql= "DELETE * from Tablename
DoCmd.RunSQL
strsql = " INSERT INTO Tablename " _
& "SELECT * FROM HoldingTable"
DoCmd.RunSQL
The problem is the two tables are different once the Tablename populated from the holding table.
Any clues as to why?
 
the two tables are different once the Tablename populated from the holding table
Different in what way?
Have you verified that the first (DELETE) query worked?
How about...
Code:
strsql= "DELETE * from Tablename [COLOR=red][b]"[/b][/color]
DoCmd.RunSQL [COLOR=red][b]strsql[/b][/color]
strsql = " INSERT INTO Tablename " _
& "SELECT * FROM HoldingTable"
DoCmd.RunSQL [COLOR=red][b]strsql[/b][/color]


Randy
 
Thanks for the reply.
I have found the problem.
One of the tables had a slightly different structure.
I have now fixed this and all now seems to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top