I am trying to add a new record to a table with the following code. I keep getting the following error.
Run time error 3001
Invalid Argument
All the other posts I found look just like mine so I can't figure out why it's not working. Since the code works with the currentdb I didn't think it would matter that my tables are linked tables. Just in case I imported the tables and got the same error. Here's my code and any help would be great.
Private Sub cmdAddSkill_Click()
Dim MyRecords As Recordset
Set MyRecords = CurrentDb.OpenRecordset("tblCharacterSkills", dbOpenDynaset)
With MyRecords
.AddNew
!CharID = Me!txtCharIDtmp
!SAreaID = Me!txtSAreaIDtmp
!SubAreas = Me!chkSubareastmp
!Attributes = Me!txtAttributestmp
!Type = Me!txttypetmp
.Update
End With
MyRecords.Close
End Sub
Run time error 3001
Invalid Argument
All the other posts I found look just like mine so I can't figure out why it's not working. Since the code works with the currentdb I didn't think it would matter that my tables are linked tables. Just in case I imported the tables and got the same error. Here's my code and any help would be great.
Private Sub cmdAddSkill_Click()
Dim MyRecords As Recordset
Set MyRecords = CurrentDb.OpenRecordset("tblCharacterSkills", dbOpenDynaset)
With MyRecords
.AddNew
!CharID = Me!txtCharIDtmp
!SAreaID = Me!txtSAreaIDtmp
!SubAreas = Me!chkSubareastmp
!Attributes = Me!txtAttributestmp
!Type = Me!txttypetmp
.Update
End With
MyRecords.Close
End Sub