I am trying to have a button run an update query using code only. Currently it works great by setting up an update query and then code a DoCmd.openquery line on the buttons code. I was trying to learn on how to not have a prebuilt query. I have tried:
Dim strsql2 As String
strsql2 = "UPDATE tblJob SET tblJob.Active = Yes WHERE (((tblJob.EstimateID)=[Forms]![frmJobMan]![List13]));"
dbExecute strsql2
I have also tried:
dbExecute "UPDATE tblJob SET tblJob.Active = Yes WHERE (((tblJob.EstimateID)=[Forms]![frmJobMan]![List13]));"
dbexecute("UPDATE tblJob SET tblJob.Active where (((tblJob.EstimateID)=[Forms]![frmJobMan]![List13]))") = 1
I am running on Access 97. It appears that it does not like the dbExecute nor db.Execute commands.
dbExecute gives "Sub or Function not defined" with dbExecute highlighted
db.Execute gives "Variable not difined" with the db highlighted
Dim strsql2 As String
strsql2 = "UPDATE tblJob SET tblJob.Active = Yes WHERE (((tblJob.EstimateID)=[Forms]![frmJobMan]![List13]));"
dbExecute strsql2
I have also tried:
dbExecute "UPDATE tblJob SET tblJob.Active = Yes WHERE (((tblJob.EstimateID)=[Forms]![frmJobMan]![List13]));"
dbexecute("UPDATE tblJob SET tblJob.Active where (((tblJob.EstimateID)=[Forms]![frmJobMan]![List13]))") = 1
I am running on Access 97. It appears that it does not like the dbExecute nor db.Execute commands.
dbExecute gives "Sub or Function not defined" with dbExecute highlighted
db.Execute gives "Variable not difined" with the db highlighted