Creating record from subform, use one of the values in main form

Snecia

Registered User.
Local time
Today, 12:34
Joined
Apr 5, 2013
Messages
12
Hi there,
I'm trying to create a record for a table that has 2 attributes:
ContainsTracks
+album
+tracks

I have my main form, where the album is determined by a TextBox. My subform has a textbox that lists the tracks (in datasheet view). I have this set up and working fine.

At the moment if I try to add a new record by typing a new entry into the subform I get the error: "Index or primary key can not contain a null value". This is because both album and tracks make the composite primary key of ContainsTracks.

My question is, how can I tell the subform to grab the value from TextBox1 in the main form as the +album when I create a new record.

I have provided two screenshot that perhaps explain my predicament a bit better:

(Not enough posts to put the links yet I'm afraid, need 10 posts...)

Thank you for your time,
 
A common mistake is to include the table from the main form in the record source of the subform. The main form should have the parent table as its record source and the subform should have the child table as its record source and the Master / Child link set a appropriately.
 
Thanks for your reply but in my case I have only one table, it's the same one used in both the main form and the subform.
 

Users who are viewing this thread

Back
Top Bottom