Background:
Front end: Access 2010
Back end: SQL Server 2008
I use the following code to write to a table and it works fine. I change the table name from "tbl_XX0200 3" to "dbo_XX0203 3" (line 16). The later is a back end table on SQL Server 2008. After I do this I get the following error: Run time error '3219": Invalid Operation. All I did was change the table name. Do I need something else since "dbo_XX0200 3" is a back end table?
Front end: Access 2010
Back end: SQL Server 2008
I use the following code to write to a table and it works fine. I change the table name from "tbl_XX0200 3" to "dbo_XX0203 3" (line 16). The later is a back end table on SQL Server 2008. After I do this I get the following error: Run time error '3219": Invalid Operation. All I did was change the table name. Do I need something else since "dbo_XX0200 3" is a back end table?
Code:
Dim supplierID As Integer
Dim key As String
Dim typex As String
Dim ratingperiod As String
Dim ratingdate As Date
Dim applevel As String
Dim rst As DAO.Recordset
supplierID = 11
key = "129FY2Q"
ratingperiod = "FY292Q"
ratingdate = Date
applevel = "Lock"
Set rst = CurrentDb.OpenRecordset("tbl_XX02003", dbOpenTable)
rst.AddNew
rst!supplierID = supplierID
rst!key = key
rst!Type = typex
rst!ratingperiod = ratingperiod
rst!ratingdate = ratingdate
rst!applevel = applevel
rst.Update
rst.Close
Set rst = Nothing
MsgBox "Insert was successful.", 48, ""
Comment