Hello,
I am trying to put in and add button to my form so it saves everything into the table, here is my code:
Private Sub Add_Click()
Dim db As Database
Dim rsWrk As Recordset
Set db = DBEngine(0)(0)
Set rsWrk = db.OpenRecordset("Table", DB_OPEN_DYNASET)
rsWrk.AddNew
rsWrk![Title] = Me![Title]
rsWrk![Length] = Me![Length]
rsWrk![Journal] = Me![Journal]
rsWrk![page_no] = Me![Page]
rsWrk![additional] = Me![Other]
rsWrk![language] = Me![language]
rsWrk![rating] = Me![InterestLevel]
rsWrk![subject] = Me![subject]
rsWrk![SecondarySource] = Me![SecondarySource]
rsWrk![accession] = Me![AccessionCode]
rsWrk![Environment] = Me![Environment]
rsWrk![generalmarket] = Me![GeneralMarketInformation]
rsWrk![Company] = Me![Company]
End Sub
But I get an error for line 5, the error is:
Runtime Error 13, Type mismatch
Thanks for your help,
Richard
I am trying to put in and add button to my form so it saves everything into the table, here is my code:
Private Sub Add_Click()
Dim db As Database
Dim rsWrk As Recordset
Set db = DBEngine(0)(0)
Set rsWrk = db.OpenRecordset("Table", DB_OPEN_DYNASET)
rsWrk.AddNew
rsWrk![Title] = Me![Title]
rsWrk![Length] = Me![Length]
rsWrk![Journal] = Me![Journal]
rsWrk![page_no] = Me![Page]
rsWrk![additional] = Me![Other]
rsWrk![language] = Me![language]
rsWrk![rating] = Me![InterestLevel]
rsWrk![subject] = Me![subject]
rsWrk![SecondarySource] = Me![SecondarySource]
rsWrk![accession] = Me![AccessionCode]
rsWrk![Environment] = Me![Environment]
rsWrk![generalmarket] = Me![GeneralMarketInformation]
rsWrk![Company] = Me![Company]
End Sub
But I get an error for line 5, the error is:
Runtime Error 13, Type mismatch
Thanks for your help,
Richard