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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append Query not populating one field? 1

Status
Not open for further replies.

glxman

Technical User
Apr 19, 2007
36
GB
I have an append query to populate a table from a couple of key reports in excel - it performs a few calculations and lookups during the import. Everything imports as it should but there is one field that does not get populated. The data shows on the query preview, but does not transfer to the table when executed. The field looks up on an open hidden form for a userID.

Code:
INSERT INTO tblKE5Ztemp(....[NetID-Imported], [Date/Time-Imported])
SELECT DISTINCT.....[Forms]![frmUSL]![txtNetID] AS [NetID-Imported], Now() AS [Date/Time-Imported]

The date/time comes in fine as well as all other data. It is only the NetID from the form that fails to import, but shows on the query preview. Any ideas?

Thanks
Richard



 
Do you get an import errors table? Could there be a difference in field types, text and numeric for example?
 
No import errors and it is just a text field - I just cannot work it out. I have another similar import that pulls the NetID info with no problems, except that does not calculate and lookup during the process. I have compared the SQL and table properties like for like and they are the same. It's just strange that I can see the data in the query preview, but it just will not append.
 
Is the form still open when you run the query? Does it work with a make-table query, rather than an append? This would show if the problem is with the the table or the query.
 
Form is open when running - I even have it visible now while I troubleshoot.

Interestingly it does fail as a make table with a type conversion failure deleting those records - the new table has that field property set to "Binary"

Why would it do this?
 
Is it possible that you have misspelt the name of the control?
 
Surely if I had I would not get the value returned in the query preview?

It appears that it reads it as a Binary value, tries to assign it to a text field in the destination table, and ultimately fails leaving it null. The fact that the make table query assigns the field as Binary indicates this to be the case.
 
I tested with a correct form name and an incorrect control name and a binary is exactly what I got, hence the question. :)
 
I have another append query doing this now aswell - reading the same control. I do get the type conversion failure warning with append and make table - I had warnings off before.

It is a pain as I really need to log this information.
 
Have you have a chance to check the name of the control?
 
Duane, I thought it was only naughty crosstabs that required that old chestnut :) - problem solved - thanks very much!

Remou, thanks for your help - I bet you're kicking yourself aswell :)
 
This was mostly an experienced guess on my part. Your results and error messages seemed to be pointing to not understanding a data type.

You might have been able to use something like:
Int([Forms]![frmUSL]![txtNetID])
or
CStr([Forms]![frmUSL]![txtNetID])

Just another WAG.


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top