Subform problems

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

I have a form of customers and a subform with Orders

frmcustomer & frmorder

I would like to be able to place three address fields into three subform
delivery address fields by default they will be duplicated in the table but
I want this for the delivery information.

I have tried this in the AfterUpdate of the CustomerID (key field) event on
the frmcustomer but it doesnt populate the fields on the subform where have
I gone wrong??

Forms![frmcustomer]![subfrmorder].Form![DelAddress] = Me!Address
Forms![frmcustomer]![frmorder].Form!DelCity = Me!City
Forms![frmcustomer]![frmorder].Form!DelPostCode = Me!PostCode

Thanks for your help,

Rob
 
Rob

Are you actually updating the CustomerID control when displaying a single
Main form record? The AfterUpdate event will fire only when the control is
updated. You may want to put this code on the Form's OnCurrent event but
*only* if the subform fields are empty.

HTH

Andy
 
Back
Top