[AccessD] Update query

newsgrps newsgrps at dalyn.co.nz
Sun Jun 5 23:23:13 CDT 2011


Also check the data in Table2:Field3_parcel_id (Text).  If you have a 
Null value and Table1:Field3_parcel_id (Text) doesn't accept nulls 
then this may cause a problem (not sure if it is this error message though).

Another thought - set up the query so that the joins between the 
tables do the matching rather than the criteria.

Regards

David Emerson
Dalyn Software Ltd
Wellington, New Zealand

At 6/06/2011, Darryl Collins wrote:

>Check that all the field data types are the same in the source and 
>target.  "Type mismatch in expression" usually means you are trying 
>to write a string value in to number field (or some other data 
>mismatch of that nature).  Could be as simple as trying to move a 
>number that is dimmed as double in one table and an integer in the other.
>That is where I would look first.
>
>cheers
>Darryl.
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com 
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bob Gajewski
>Sent: Monday, 6 June 2011 1:41 PM
>To: 'Access Developers discussion and problem solving'
>Subject: [AccessD] Update query
>
>Hi Folks
>
>I am having trouble getting an update query to work.
>
>Table1
>         Field1HouseNumber (Number, Long Integer)
>         Field2StreetID (Number, Long Integer)
>         Field3ParcelID (Text) ..................... Currently all empty
>
>Table2
>         Field1_loc_st_nbr (Number, Long Integer)
>         Field2_loc_st_name_id (Number, Long Integer)
>         Field3_parcel_id (Text)
>
>I need to populate Table1, Field3 with the contents of Table2, Field3 *if*
>Table1/Field1 = Table2/Field1 <and> Table1/Field2 = Table2/Field2.
>
>My update query has three columns:
>
>Column1
>         Field: Field1HouseNumber
>         Table: Locations
>         Criteria: =[Table2].[Field1]
>
>Column2
>         Field: Field1StreetID
>         Table: Locations
>         Criteria: =[Table2].[Field2]
>
>Column3
>         Field: Field3ParcelID
>         Table: Locations
>         Update To: [Table2].[Field3]
>
>Whe I click on "Run", I received the following error:
>         "Type mismatch in expression"
>
>I would *really* appreciate and hekp, suggestions or direction here ... I've
>never done an update query that matches on more than one criteria before ...
>
>Thanks
>Bob Gajewski
>
>PS - I know how to write the entire update procedure in a VBA module ... But
>where would I execute it?




More information about the AccessD mailing list