Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating subform field from main form

Status
Not open for further replies.

Sloaner

Technical User
Jun 21, 2004
39
US
How can I update a field in a subform table from the Main table?. I have a main form Orders with a ComboBox ReceivingCompanyID; and in the afterupdate event procedure of ReceivingCompanyID I want to update the table of the subform. I have the following code which gives me an error.

Code:
Forms![Orders]![Order Details]![RecipientID] = Me.ReceivingCompanyID

The error is :
" You cann't assign a value to this object".

Any suggestions on how to implement this correctly?
 
Sloaner

Although Zameer's coding should work, why are you assigning the CompanyID to the detail component of the data? Can one invoice consist of invoice detail items that are billed to one customer but shipped to others? If so, then you may want to add a combo box to the detail section and select the recipient.

See the following links on normalization...
or

And

Richard
 
And this ?
Me![Order Details].Form![RecipientID] = Me!ReceivingCompanyID

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi

In short Do not do it

You can achieve the desired result with a recordset based on a query joining Order Header and Order Detail tables on OrderId, tehre is no need to duplicate the recipientid in the detail table. See my answer to your other question on SubForm based on Recipient

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top