Update using specified field

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.
 
M

Marshall Barton

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.
 
M

Michel Walsh

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
 

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

Top