Well, C&R didn't help any. I imported everything to a new file and no longer get error on CurrentDb. Your original db must be corrupted beyond repair. The new file does error on Me.InventorySkillGroup1_txt - 'not found'. I can't find any control by that name.
The 'Add New Skills' button is on main form but textboxes are on subform. Syntax for main form code to refer to subform control is:
Me.containername.Form.controlname
I always give subform/subreport container control a name different from the object it holds, like ctrSkills. Then your code will be:
!InventorySkillGroup = Me.ctrSkills.Form.InventorySkillGroup1_txt
The looping code would be like:
Code:
For i = 1 to 20
With rst
.AddNew
!InventorySkillGroup = Me.ctrSkills.Form.Controls("InventorySkillGroup" & i & "_txt")
'... same structure for other fields - get the names right - including the PayrollInventoryID and PayrollSkillID
.Update 'I am not sure but this might should be outside the loop just before the rst.Close
End With
Next
rst.Close