update query problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to update fields in one table (Table 1) with a field(s) in
another table (Table 2). In the update to line I use the following for
Field1 and Field2 from Table1.

[tblTable2]![Field1] [tblTable2]![Field2]

The view of the query (before running) leaves Field2 from Table1 null even
though that field is not null in Table 2.

I do not understand what is going wrong.

Thanks,

LAF
 
I am trying to update fields in one table (Table 1) with a field(s) in
another table (Table 2). In the update to line I use the following for
Field1 and Field2 from Table1.

[tblTable2]![Field1] [tblTable2]![Field2]

The view of the query (before running) leaves Field2 from Table1 null even
though that field is not null in Table 2.

I do not understand what is going wrong.

Thanks,

LAF

Use . instead of !, and you *MUST* join the two tables:

UPDATE tblTable1
INNER JOIN tblTable2
ON tblTable1.Joinfield = tblTable2.Joinfield
SET [tblTable1].[Field1] = [tblTable2].[Field1],
[tblTable1].[Field2] = [tblTable2].[Field2]

You do need a join field which uniquely identifies which record is to
be updated.

John W. Vinson[MVP]
 
Back
Top