View Full Version : APDATE DATE FROM ONE FORM TO ANOTHER


MICHELE
07-27-2001, 12:05 PM
I have a form and a subform. I want a date from the subform to be updated with a date from the main form if a condition of another field on the main form is met.

If New Job = "Y" Then Ship to Amt will update to JOBCONAMT

Where and how can I write this?

Pat Hartman
07-29-2001, 09:25 AM
You do not need to duplicate data from the parent record in the child records. You can always get the data by joining the child table back to the parent table.

MICHELE
07-30-2001, 05:05 AM
I thought about linking the fields, however, I don't want the 2 field amounts to always be equal to each other. The amount in the field of the parent table will change while the amount in the field of the child table will remain the same. When the record is added in the child table, that will be the only time the field amounts are equal.

Pat Hartman
07-30-2001, 05:21 AM
In the BeforeUpdate event of the subform, put the code that checks the conditions and populates the ship to amount.


If IsNull(Me.[Ship to Amt] Then
If Parent.[New Job] = "Y" Then
Me.[Ship to Amt] = Parent.[JOBCONAMT]
End If
End If



[This message has been edited by Pat Hartman (edited 07-30-2001).]