Cannot copy all data from a query to a table

NJudson

Who farted?
Local time
Today, 09:34
Joined
Feb 14, 2002
Messages
297
I'm using Access 2003 and winXP. I built a database a long time ago and it worked fine, but some things have changed in the data and required output so I need to tweak some of the program. The following code ran fine before and copied 100% of the data from the query to the table, but now it is only copying about 80% of the data. The data that is being stripped off is the new data that I need to use in the output.

Function ClearAndrewTemplateContents()
Dim dbs As DAO.Database
Set dbs = CurrentDb
dbs.Execute ("DELETE * FROM AndrewTemplate")
End Function
Function LoadAndrewTemplateContents()
Dim dbs As DAO.Database
Set dbs = CurrentDb
Dim SQL As String
Call ClearAndrewTemplateContents
SQL = "INSERT INTO AndrewTemplate SELECT * FROM
End Function

There is about 40 fields being copied, but for the new data that is being stripped some of the fields are blank or nulls. Does the SQL line that I wrote require all fields to be populated? Is this why the new data is not being copied? Thanks for any help.
 
Insert into xxx SELECT assumes all fields (typically) are being supplied. The bigger question is, on the source of the data what is the value of those fields?n Since from your post it appears the insert is working, then it sounds more like a data issue than a syntax issue.
 
FoFa said:
Insert into xxx SELECT assumes all fields (typically) are being supplied. The bigger question is, on the source of the data what is the value of those fields?n Since from your post it appears the insert is working, then it sounds more like a data issue than a syntax issue.

I think you're right. I believe it has something to do with data types for the AndrewTemplate table, but I haven't quite narrowed it down yet. Thanks.
 

Users who are viewing this thread

Back
Top Bottom