PK of one form editing a value in another opened form...

Ecron

Registered User.
Local time
Today, 15:36
Joined
Aug 31, 2006
Messages
58
So, I hope that i'm just making a simple error, because as far as I know this should work!

I have two tables. (and i'll just simplify it because the other info isn't necessary to aide me!)

tblProduction
ProductionID - Autonumber - PK
ProductionLocation

tblStorage
StorageID - Autonumber - PK
StorageLocation
ProductionID

Now. I have two forms. One is frmProduction and the other is frmProduction_Stored.

A user inputs in the frmProduction form and then has a drop down that determines the "disposition" of the items produced.
Once that disposition is selected it will open up one of three forms(depending on the value selected), in this example it is frmProduction_Stored.
It then opens up that form and fills in tblStorage.ProductionID with tblProduction.ProducitonID. And then the user can fill out the rest of information required for tblStorage.

But, the problem i'm having is that the records are not getting created in tblStorage. I have created the relationship and tried different things and have found out that they do NOT create only IF i have "Enforce Referential Integrity" selected on the reltionships! Otherwise, it creates the records perfectly fine, with the right ProductionID on tblStorage, but then the relationship isn't appropriate.

hmmm


Any ideas how I can fix this problem and make tblStorage create the records, with the right relationship?

Thanks!
 
Do you save the current record in frmProduction before opening one of the tree other forms?
If not there's no record to relate to, so you won't be able to save the record in frmProduction_Stored when "Enforce Referential Integrity" is checked.
 
Indeed I have not.

I am unaware of the "save command" for data entry. Perhaps you could enlighten me? Hopefully one that does not require the closing of a form...

But, yes. I can see how that would destroy my hopes of success.

Thanks!
 

Users who are viewing this thread

Back
Top Bottom