Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form/Subform Update Question

Status
Not open for further replies.

Izzy2009

IS-IT--Management
Joined
Dec 16, 2008
Messages
6
Location
US
I am creating a form that is going to pull from two separate tables. The form(tblLot) has a subform in it (tblShift), which allows a user to enter information concerning the shift (ie: shift_date, amount_batches, etc). The form has a combo box that allows the user to select a week, then auto-populates the subform with the applicable shift data.

My question is that when I go to add a record in the subform, I receive the error "the Microsoft Database engine cannot find a record in the table 'Lot' with key matching fields 'Lot_Num'. I've read that the easiest way to fix this is either to change the default value property to 1 of the Lot_Num field, but I want to maintain unique lot numbers. I've also read that deactivating referential integrity would work, however it didn't. :(

Any ideas on the best course of action?

Attached is a pic of the relationship if my description was unclear.

Thx

~ | Macbook 2.4 ghz | OS X ~10.5.6~ | ~
 
Your probably is that your subform is not linked correctly to your master. If you link the subform correctly then any new record in the subform will get a foriegn key to the selected record in the master. In other words if lot_num ABC is in the master every new record in the subform will get an ABC in its lot_Num field. Check the properties of the subform control
Link Master fields: [lot].[lot_Num]
Link Child fields: [shift].[lot_num]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top