Value cannot be added to new row until new row has been committed

hunterfan48

Registered User.
Local time
Today, 02:38
Joined
Aug 17, 2008
Messages
436
So...I looked up some info on this, but I can't seem to figure out why it's happening to my form.

So, on my [Transactions] form I am entering a new transaction number.

Let's call it (105)

So, now I click one of my command buttons which will pop up a new form allowing me to enter new cards into my database associated with transaction (105).

The 1st card I enter works great. When I move on to the second card I'm adding to this particular transaction, I go to enter (105) into my Transaction ID field on this popup form just as I did on the 1st. This will tie this specific card to transaction 105. However, now I get this error message that I see in the title line.

My question is, where did this error message come from? How can it be fixed?

And why would it do it on the second card (or new record in my popup form) and not the 1st new card or record? I repeat the exact same process for both of them.

Thanks!
 
The order in which you do the save is the key.

If the popup is a child form (sub-form) of the first entry but the parent/child links have not been correctly set, then Access is telling you that the parent hasn't been committed yet. Can't have kids without parents, you know. Normally, if this were an embedded form, the commitment would be automatic. However, pop-ups are a different animal (sometimes) and I guess you tripped on one of those times.

In the button you use to trigger the pop-up, you might consider doing a "Save Record" before you pop up the child form. There is a wizard to build command buttons that would show you the VBA code to do that behind the button.

BTW, you double-posted this question. You can delete or withdraw the second posting since you created it.
 
Ok, but why would it work for the 1st new record I enter on the pop-up form but not on the second one? I can see the problem as you described, but it doesn't make sense to me that it wouldn't cause any problems on the 1st record, but when I go to add another record it gives me issues.

That's what I'm trying to figure out
 
I have three main tables.

1) tblInventory
2) tblTransactions
3) tblTransactionID

From my (ID) field in tblTransactionID to my (ID) field in tblTransactions it shows a many-to-one relationship.

This popup form is based off a query.

In the query, it has a field (which is causing me the problems) by the name of tblTransactionID.ID simply meaning from the table (tblTransactionID) there is a field in there (ID) that I've picked to include in my query.

From the original main form, I enter the Transaction ID number for the new transaction. Like I said earlier, I then click a command button to open a new form (based on the query above) to enter the details about the new card as well as enter in this card's transaction number. Whenever I try to enter the Transaction number in this pop-up form based off this query, I get this error message.

Hopefully these details help.

Thanks!
 
Here's another funny thing. This new Transaction ID (105) has now already been created. If I exit out of all these forms and go look at my Transactions table, there is a row (or record) that has Transaction ID (105) and all the other details I entered in for this particular transaction. So, why if this new record shows up in my original table, which means to me that it's already been saved, then why will it not let me add new cards and put the (105) value in for the tblTransactionID.ID field in my query that I have this form based off of??
 
The problem, from what I've read, would seem to be something wrong with either your relationships and/or the query itself. I would have to see the database to know exactly what it is.
 
Ok Bob...this query wasn't quite working for me after several attempts. I will try to head in a new direction.

Thanks for responding.
 

Users who are viewing this thread

Back
Top Bottom