passing value from main form to sub form

  • Thread starter Thread starter rathika
  • Start date Start date
R

rathika

hi

i have a value in main form which i want to use it
in a sub form.
pls. tell me how do i do that including which events
i should use in both the forms.

pls. give me the syntax of the code also.

any quick help is appreciated.
rathika
 
i have a value in main form which i want to use it
in a sub form.
pls. tell me how do i do that including which events
i should use in both the forms.

Private Sub MyControlOnParent_AfterUpdate()
'Ctrl1 = Control on main form
'Ctrl2 = Control on sub form
'Sub1 = Control-name of sub form (not the sub-form name)
If Nz(Me!Ctrl1.Value,"")<>"" Then
Me!Sub1!Ctrl2.Value = Me!Ctrl1.Value
End If
End Sub

HTH - Peter
 
Back
Top