"TJ" <rl******@charter.net> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
I have a form that has a subform in it that links the Company_ID to the
Shipper_ID. This works except when I want to let the user add a record.
I then get a information message box saying that the record is suppose
to have a value in it that matches the main form.
Can I set the subform's link field with the master field in VBA?
What I would like to do is something like this:
Sub Click_Add()
Me.ChildField.Value = ShipperID
Me.MasterField.Value = CompanyID
End Sub
Your help is greatly appreciated.
Not sure I understand...that error would normally occur if the user went to a
new parent record and tried to enter data in the subform before they had first
created (entered some data into) the new parent record.
As long as they are on an existing parent record then adding new records in the
subform should not be a problem.
Besides this your fields sound incorrect. A Shipper record should have a
ShipperID and a CompanyID and the link should be on CompanyID. Linking between
CompanyID and ShipperID doesn't make sense to me.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com