copy field data from main form to subform

J

Jae Hood

Is there VBA code that I could stick in an after update event procedure that
would take the data from one field on my main form and input that same data
into another field on my subform?
I can't use formlink properties because it would interfere with the current
link properties and cause them not to work.

Thanks,
Jae
 
W

wendell remolador

maybe something like:

forms![MyMainForm]![MyField] =
forms![MyMainForm]![MySubformObject].Forms![MyFieldinSubform]

or

forms![MyMainForm]![MySubformObject].Forms![MyFieldinSubform] =
forms![MyMainForm]![MyField]

its vice versa.

put that either in onExit of the object in focus or in whatever event you
like it to be triggered.
 
J

Jae Hood

Hey,
No go, it says can't find form referred to in VBA code, but the form does
exist and is typed properly in the code.

Thanks anyways,
Justin

wendell remolador said:
maybe something like:

forms![MyMainForm]![MyField] =
forms![MyMainForm]![MySubformObject].Forms![MyFieldinSubform]

or

forms![MyMainForm]![MySubformObject].Forms![MyFieldinSubform] =
forms![MyMainForm]![MyField]

its vice versa.

put that either in onExit of the object in focus or in whatever event you
like it to be triggered.

Jae Hood said:
Is there VBA code that I could stick in an after update event procedure that
would take the data from one field on my main form and input that same data
into another field on my subform?
I can't use formlink properties because it would interfere with the current
link properties and cause them not to work.

Thanks,
Jae
 
Top