Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dbSeeChanges with db.Execute qrytxt 1

Status
Not open for further replies.

VicRauch

Programmer
Sep 26, 2004
242
US
I have the following code in an Access DB (.mdb) that gives me an error now that all my tables have been upsized to SQL Server.
Code:
Dim QryTxt as String
Dim DB as DAO.Database

  Set DB = CurrentDB()
  QryTxt = "UPDATE tblJob SET BillingAmount = " & _
      [blue]GetBillingAmount[/blue](JobID) & " " & _
      WHERE JobID=" & JobID & ";"
  DB.Execute QryTxt
[blue]GetBillingAmount[/blue] is a function to return the BillingAmount and it works fine.
The last line (DB.Execute QryTxt) produces this error: You must use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column.
Is there any way to use the dbSeeChanges option with this code? I know where to use it with the OpenRecordset code, but do not know where to put it in code that is executing an update query.
Any ideas?
Thanks,
Vic

 
Try:
DB.Execute , dbSeeChanges
Using this syntax: CurrentDb().Execute
if you enter a comma after .Execute you will see a place for Options with AutoComplete.

 
Robert,
Thank you! I never thought to try the comma. All the things that Google brought up were for the OpenRecordset.

Thanks again,
Vic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top