APDATE DATE FROM ONE FORM TO ANOTHER (1 Viewer)

MICHELE

Registered User.
Local time
Today, 09:41
Joined
Jul 6, 2000
Messages
117
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

Super Moderator
Staff member
Local time
Today, 04:41
Joined
Feb 19, 2002
Messages
43,275
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

Registered User.
Local time
Today, 09:41
Joined
Jul 6, 2000
Messages
117
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

Super Moderator
Staff member
Local time
Today, 04:41
Joined
Feb 19, 2002
Messages
43,275
In the BeforeUpdate event of the subform, put the code that checks the conditions and populates the ship to amount.

Code:
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).]
 

Users who are viewing this thread

Top Bottom