Help Regarding an update query

S

Samer

Hi, iam trying to run an update query. the situation is as follows, i
have linked excel sheets in my table. so i am using the update query
to update all the records that i have them in my access tables. i
tried this before many times and i was successful in doing that. But
in some tables, it gave me an error message "Type mismatch in
expression". i checked each and every field in my access table and in
the excel sheets and they are all with the correct format. any help??
any ideas?
 
J

John W. Vinson

Hi, iam trying to run an update query. the situation is as follows, i
have linked excel sheets in my table. so i am using the update query
to update all the records that i have them in my access tables. i
tried this before many times and i was successful in doing that. But
in some tables, it gave me an error message "Type mismatch in
expression". i checked each and every field in my access table and in
the excel sheets and they are all with the correct format. any help??
any ideas?

Access has "strong data types" - a field must have a defined datatype, such as
Text, Number... Long Integer, etc. Excel doesn't! When you link an Excel
spreadsheet, Access must *guess* at the datatype based on the content of the
first few rows. It can guess wrong, and often does.

What you might need to do is do this in two stages: create a local Access
table with the desired datatypes; link to the spreadsheet and run an Append
query to fill the local table. Then base your update query on the Access table
rather than the spreadsheet directly.

John W. Vinson [MVP]
 

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

Similar Threads


Top