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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating another record based on a current record

Status
Not open for further replies.

willsth

Programmer
Oct 3, 2008
33
GB
I have a form called "Project Details" and I am trying to link two records in the same table together.

The Table is "Projects". My records contain the following data:-

ID
Project Name (Numeric field)
LinkJob (Numeric Field)
etc....

Say I have 5 records in my file with Project Names - 123,124,125,126,127.
I have record 123 as my current record and I have a combo box which retrieves these Project Names and I update the field LinkJob with the appropriate linked-job e.g. 127. On AfterUpdate I wish to automatcally update the Record with Project Name 127 with the entry 123 in LinkJob, to complete the cross-reference.
I am trying to use currentDB.execute but am struggling with the syntax.

Any help with the code would be grateful
 
CurrentDb.Execute "UPDATE Projects SET LinkJob=" & Me![project name control] & " WHERE [Project Name]=" & Me![link job control]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top