passing value from main form to sub form

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
 
P

Peter Doering

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top