Mainform to subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a main form [PreDeliveryOrderFrm] and Subform
[Predeliveryorderdetailsfrm]
I use the afterupdate event to pass a value from the main form to the
subform.
I use the following code which works however the value is only being pass to
the first line in the subform instead of all lines.

Please Help

Private Sub ManifestConsignee_AfterUpdate()
Predeliveryorderdetailsfrm.Form!predeliveryCustID = [predeliveryCustID]
End Sub
 
Hello,

I have a main form [PreDeliveryOrderFrm] and Subform
[Predeliveryorderdetailsfrm]
I use the afterupdate event to pass a value from the main form to the
subform.
I use the following code which works however the value is only being pass to
the first line in the subform instead of all lines.

Please Help

Private Sub ManifestConsignee_AfterUpdate()
Predeliveryorderdetailsfrm.Form!predeliveryCustID = [predeliveryCustID]
End Sub

For the record, *any* form can only have one CurrentRecord including your
SubForm. The code you have simply sets the predeliveryCustID control the
Current record of the SubForm. You would need an Update query to set all of the
records, or at least that would be the easiest method. What are you using as
the LinkChild/MasterFields? If somehow it were the predeliveryCustID field then
Access would take care of that task for you.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 

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

Back
Top