By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

Sub Form - Linked Child Field - Linked Master Field

P: n/a
TJ
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.

Thanks

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Is there a reason you're not declaring the relationship explicitly? If
you do that, the LinkChild and LinkMaster fields fill in automatically.
Otherwise, you have to fill them in yourself.

Nov 13 '05 #2

P: n/a
"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

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.