I changed my tables around in my db so they make a bit more sense then created a form for entry.
I have added the following code to the form as one of the tables only needs to be filled out if certain criteria are met.
Now when I go to enter in the form it tells me on the bottom: Cannot add records; join key of table tblOSHA not in recordset.
The table is the sub form and is required to be filled out but only in the other table is it reliant on being filled out. I hope I'm making sense.
I have attached the relationship report as well so you can see the tables.
Thank you looking at it and thank you again for help with my previous questions regarding this db!
I have added the following code to the form as one of the tables only needs to be filled out if certain criteria are met.
Code:
Private Sub Form_AfterUpdate()
Call SetCntrlProperties
End Sub
Private Sub Form_Current()
Call SetCntrlProperties
End Sub
Private Sub SetCntrlProperties()
Select Case Me.cboEmploymentStatus
Case "Eligible", "No Rehire", "Disability"
Me!OSHATraining.Form!JobNumber.Enabled = False
Me!OSHATraining.Form!JobNumber.Locked = True
Me!OSHATraining.Form!EmployeeType.Enabled = False
Me!OSHATraining.Form!EmployeeType.Locked = True
Me!OSHATraining.Form!CraftCode.Enabled = False
Me!OSHATraining.Form!CraftCode.Locked = True
Case Else
Me!OSHATraining.Form!JobNumber.Enabled = True
Me!OSHATraining.Form!JobNumber.Locked = False
Me!OSHATraining.Form!EmployeeType.Enabled = True
Me!OSHATraining.Form!EmployeeType.Locked = False
Me!OSHATraining.Form!CraftCode.Enabled = True
Me!OSHATraining.Form!CraftCode.Locked = False
End Sub
Now when I go to enter in the form it tells me on the bottom: Cannot add records; join key of table tblOSHA not in recordset.
The table is the sub form and is required to be filled out but only in the other table is it reliant on being filled out. I hope I'm making sense.
I have attached the relationship report as well so you can see the tables.
Thank you looking at it and thank you again for help with my previous questions regarding this db!