473,508 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sub Form - Linked Child Field - Linked Master Field

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
2 4941
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3310
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text field called . It gets populated based on what the user selects in a field on the...
1
1720
by: Richard Hollenbeck | last post by:
I'm getting errors. Access is telling me that it can't add a record. I have a table of college courses and a linked table of groups of activities in that course as a linked table (one course to...
0
1370
by: Alienz | last post by:
Hey all. if anyone is REALLY bored please help moi. I am new to access stuff and am probably missing something obvious here. I have 2 tables that are linked via "number" in the relationship...
4
1375
by: David Gunnarsson | last post by:
I'm using Access as a front-end to a MySql database, through ODBC. I have a form set up for entering information about projects and that form has, among other things, a subform where you can...
4
6968
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
3
2226
by: Robert McEuen | last post by:
Using A2K3, Windows XP I'm handling a many-to-many relationship with a linking table structure as follows (irrelevant fields omitted): tblIssue PK_IssueID (autonumber, primary key) IssueName...
2
8375
by: darnel | last post by:
I have 4 hierarchical tables and want to display it all together as a form and 3 subforms, when subform displays (and allow to add/edit) only relevant items from each superior subform. Tables are:...
1
2294
by: Moish | last post by:
I have a form that does not have any bound fields. I want to open a subform on that form to a specific record based on the value of an unbound field on the main form. Obviously the subform is not...
12
3005
by: banderson | last post by:
Hello all, I am hoping that you can help me with a problem that has occurred numerous times on various forms in the two databases that I am working on. When I first add a subform to a form linking...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.