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

code / query to update field in second table

Status
Not open for further replies.

rgatrell

Technical User
Sep 6, 2003
14
0
0
GB
I hope this makes sense:


2 tables - "tblVehicles", "tblJobs"

The table "tblJobs" has a field named "JobIsMOT" (yes/no field) and a field named "JobDateCompleted" (date field)
The table "tblVehicles" a field named "VehicleMOT" (date field)

The idea is to have the jobs form (which is bound to "tblJobs") update the field "VehicleMOT" in the table "tblVehicles" with the date from the field "JobDateCompleted" on the jobs form, but only for the current job and only if the user has ticked the "MOT" box (bound to "JobIsMOT") on the jobs form.

The outcome is to allow the user to see the date of the last MOT for a particular vehicle.

Hope someone can help

Thanks
 
Instead of binding to a table (which you should never ever do), bind to a query which has both tables in it. You can then simply set the VehicleMOT field via a convenient event rather than having to run any separate SQL.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top