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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record doesn't save...

Status
Not open for further replies.

metrodub

Technical User
Dec 29, 2004
82
US
I have a form that employees use to process a work order for training and development. In the form are a number of combo boxes, a few with employee names. The user chooses a HR Representative from one combo box, then chooses a manager from another combo box.

If a user doesn't select an employee from both comboboxes (1 HR rep and 1 manager) then the record does not save. The combo boxes are not cascading and the fields are not required. I have a textbox that shows the record number and once a user starts filling in data a number appears, but if you close the form and come back to do a search, the record is not there and not in the back-end database.

Any ideas why this may be happening?

Thanks
 
That seems to be the issue, but I have the field in the recordset set to NOT required. Why would I continue to get this error?
 
If the forced save, as recommended in the link, doesn't work, I don't know, I'm afraid. Do you get any errors if you try to save the record manually prior to closing the form (shift+enter)

Roy-Vidar
 
This is the error that I get:

You cannot add or change a record because a related record is required in table 'PeopleEmp'

The combobox sends the EmpID (Primary Key in the PeopleEmp table) to the Work table as a Foreign Key. That field is not required in the Work table though.
 
If it's set to allow Nulls, I wouldn't be surprised if it had a default value (for numerics, typically 0) - this would normally indicate there is a value in the foreign key field (0), but a related record can't be found.

If this doesn't work, and you really wish to create orphan records, you could remove the enforce referential integrity checkmark of the relationship.

Roy-Vidar
 
Thanks for your help. I placed a label in the area stating that all fields were required so that data wouldn't be lost.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top