Update using specified field

  • Thread starter Thread starter MAJICMnt
  • Start date Start date
M

MAJICMnt

For simplicity sake, let's say i have two tables

Table_1:
ID
Name
Field3
Field 4

And Table_2
Field_Name
ID_Number
Result

I want to be able to type in Table_2:

Field_Name: Name
ID_Number: 24--Relationship to Table_1
Result:

Then run an update query that looks at Field_Name and ID_Number from Table_1
to update the Result field. I can't figure out how to turn the value for
Field_Name into linking information.
 
MAJICMnt said:
For simplicity sake, let's say i have two tables

Table_1:
ID
Name
Field3
Field 4

And Table_2
Field_Name
ID_Number
Result

I want to be able to type in Table_2:

Field_Name: Name
ID_Number: 24--Relationship to Table_1
Result:

Then run an update query that looks at Field_Name and ID_Number from Table_1
to update the Result field. I can't figure out how to turn the value for
Field_Name into linking information.


You can't without using a VBA procedure to construct the
approproate SQL UPDATE statement.
 
If you mean that Field_name hold one of the three values: "Name","Field3",
"Field4", then



UPDATE table_2
SET result=DLookup( field_name, "Table_1", "id=" & id_number)






Hoping it may help,
Vanderghast, Access MVP
 
Back
Top