Code won't work

S

SF

Hi,

I have a form with several fields for user to enter information and update
product info. In rerurn I receive a runtime error # 3622 "You must use the
dbSeeChanges option with Openrecordset when accessing a SQL Server table
that has an Identity column. I still got the same error when I replace
dbs.Execute Stg, dbFailOnError with dbs.Execute Stg, dbFailOnError,
dbSeeChanges

I use Access 2003 connect ot SQL Server thru ODBC.

Dim Stg As String
Dim dbs As DAO.Database

Set dbs = CurrentDb

Stg = "UPDATE tblProducts SET tblProducts.ProductName_e = '" &
Me.ProductName_e & "', "
Stg = Stg & "tblProducts.ProductName_k = '" & Me.ProductName_k & "', "
Stg = Stg & "tblProducts.CategoryID ='" & Me.CategoryID & "', "
Stg = Stg & "tblProducts.SubCategoryID ='" & Me.SubCategoryID & "'"
Stg = Stg & " WHERE (((tblProducts.ProductID)=" & Me.ProductID & "));"

dbs.Execute Stg, dbFailOnError


SF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Runtime error 91 2
Error 3622 0
Excel workbook and printing 3
Code wont work 2
Help with code 2
Data entry with Leban RTF 0
Exort set of queries to excel 2
Help with This Code 2

Top