[AccessD] Update query

jwcolby jwcolby at colbyconsulting.com
Mon Jun 6 05:07:05 CDT 2011


If the data types are the same do a join on the fields to compare.  Then update the necessary field.

John W. Colby
www.ColbyConsulting.com

On 6/5/2011 11:41 PM, Bob Gajewski wrote:
> 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