Value cannot be added to this new row

overworked

New member
Local time
Today, 07:54
Joined
Nov 20, 2012
Messages
7
I am using Access 2010. I have a form with subforms and I am getting "Index or Primary key cannot be Null value" when I try to enter the data in the subform. When I open the subform directly and try to enter the data in that form I get "The value cannot be added to this new row until the row has been committed. Commit the row first, and then try adding the value."

So I have frmEventDetals which is based on a query on the joining of my Customer and Event Details tables, joined by the Customer ID. The frmEventDetails allows selection of the Customer. Within frmEventDetails there is sbfEvent, sbfEvent uses the Event Details Extended query. The query uses the Event Detail, Event Status and Venue tables. The form and subform are linked by the Customer ID. Event Details form is attached for visual aid.

Steps that I am taking are,
1) Form opens and I select a customer from a drop down list, address and phone information is automatically populated and allows me to change anything that I might need to.
2)I try to enter data into the Event Subform, I get the message "Index or primary key cannot contain a Null value." Actually, I get the message as soon as I click a field in the subform.

What am I forgetting to get the subform to open up a new record?:banghead:

I am suppose to have this database done for the first of the year, so thank you in advance for any help.
 

Attachments

Last edited:
Did you use the LinkMasterFields LinkChildFields?

It sounds like you're trying to add a record on the many side of a 1 to many relationship and there is no associated record on the 1 side.

It's like trying to add a Child before you identify the parent.

The subform record must be "tied" to a record on the main form. The main form record MUST exist before a child record can be added (inserted into a table).
 

Users who are viewing this thread

Back
Top Bottom