Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update tableA.fieldX from form entry in tableB.fieldY

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I've read several threads on what seems to be a similar problem, but I still haven’t been able to make this work. It may be the way I'm trying to link the tables, because the closest I've gotten is when I enter data in the form in the field linked to tableB.fieldY a popup window asks for the linking field for the two tables. If I enter that data it updates tableA.fieldX. So I guess my question is how do I write an expression or code to link the current record which is based on a field in tableB which is the primary key field in tableA.
 
Just in case this is helpful to someone else.
After trial and error I finally got the results I was looking for. Below is the code that worked for me.

UPDATE TableA
SET [TableA].[fieldX] = [FormName]![TableB]![FieldY]
WHERE [FormName]![TableB]![LinkedField]=[TableA].[LinkedField]

Although no one answered this thread I was helped by reading other threads on a similar topic, so thanks to everyone using Tek-Tips
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top