update values in a subform based on a value in a main form (1 Viewer)

Emma

Registered User.
Local time
Today, 16:37
Joined
May 11, 2000
Messages
37
Hi

I have a main form "Tender" linked to a subform "Project" - which shows single records at a time. The user has navigation keys to move through all Projects related to a single Tender in the main form.

The parent-child relationship is between a field "Tender" - However I also have a second field that is recorded in both tables which is the same for both Project and Tender (field AREA). For reasons best left out, this field is required in both tables and Tender Area must always equal Project Area.

Therefore, if some one enters a record into the tender table and creates a new project I simply set the value from the Area field in Tender to the Project Area field - no problem, this works fine.

But, how can I update records linked to a tender if the person realises they have entered the wrong area in the Tender Table? I need to update all the records associated with that Tender to show the correct Areas in the Project table.

On the OnChange event of the Area field in the Tender Form, I put the following:
Forms!FRM_TENDERS!SFM_PROJECTS!AIRPORT_NAME.VALUE = Forms!FRM_TENDERS!AIRPORT_NAME.VALUE
however (not unexpectedly!!) the only record that in the subform was the one being viewed at the time the Tender Area field is updated - the other records remained the same!

Please help - I am sure this is probably very simple and a really stupid question. I shall continue trying to solve this but any help/advice would be very gratefully received!

Best wishes
Emma



[This message has been edited by Emma (edited 06-14-2001).]
 

AlanS

Registered User.
Local time
Today, 11:37
Joined
Mar 23, 2001
Messages
292
Have you tried setting up a relationship between the two tables, including the Area field in the relationship, and enabling Cascading Updates? That way, if the value of Area changes in the Tender table, that change will automatically ripple through to all related records in the Projects table.

Hope this helps.

Alan
 

Users who are viewing this thread

Top Bottom