Error with combo box access 2013

alnilla

Registered User.
Local time
Yesterday, 19:35
Joined
Jul 19, 2012
Messages
39
Hi guys,

I'm making a db here from scratch. I am using 2013. I have two tables and i will post a picture with it. I am having problems when i select the field from the drop down. I will select it go and enter all the data then i get an error that pops up when i try to add another record that says. You cannot add or change a record because a related record is required in table "tblEquipment" What i am trying to do is have a combo box that selects all the equipment. I made a qry already called qrylookupequipmentname and the qry runs fine and shows the proper information it just wont let me add anything when the form is open. Any help would be helpful.
 

Attachments

  • relationship1.jpg
    relationship1.jpg
    74.7 KB · Views: 169
I think the error message is telling you that

Code:
When you have a 1 to Many relationship, 
you can not add a record to the many table 
unless there is an [U]existing, related record[/U] in the 1 table

Consider a 1 to Many example -- Parent(1)--> Child(M)
You can NOT add a Child unless you identify the Parent.
 
What record would I have to add?? and to what table?
 
In your diagram tblEquipment is you 1 table, tblPMDate is your many table.

It appears you are trying to add a record to tblPMData with an EquipmentID that does not match an ID value in tblEquipment.

It isn't clear what your business rules are/should be, but that is what your relationship is showing, and how the error message fits.

Perhaps you should tell us in plain English (non Access terms) WHAT you are trying to do.
 
What im trying to do is make a Preventive Maintenance Database. I want one place to enter all the equipment and another where you enter the tasks that need done and the date it needs to be completed by. Then also do a report for what needs done in the month of December etc.

Thank you!!
 
I think you need some additional tables to help support your business processes.
You have several pieces of Equipment.
You have several Tasks.
Not all Tasks apply to each and every piece of Equipment.
Some Tasks may have to be performed several times on a piece of Equipment.
A Task is performed on a piece of Equipment on a specific Date.

Here is a free data model related to Vehicle Maintenance that may help you with your Tables.

http://www.databaseanswers.org/data...maintenance_with_attributes_print_version.htm

http://www.databaseanswers.org/data_models/vehicle_mileage/vehicle_mileage_physical.htm
 
Last edited:
Found he issue it was when i didnt included in the qry of the form the equipmentname to write to it
 

Users who are viewing this thread

Back
Top Bottom