S
SAP2
Hello,
I am using Access 2003. I am trying to run an update query through VBA. My
SQL is this:
UPDATE CostSummarySheet SET CostSummarySheet.Active = Forms!fsubLOA!Active
WHERE (((CostSummarySheet.Proj_Name)=[Forms]![frmCSSheetEdit]![Proj_Name]));
and the code I am attempting to use is this:
Dim db As DAO.Database
Dim strSql As String
strSql = "UPDATE CostSummarySheet SET [Active] =
[Forms]![frmCSSheetEdit]![fsubLOA]![Active] WHERE [Proj_Name]=
[Forms]![frmCSSheetEdit]![Proj_Name];"
Set db = DBEngine(0)(0)
db.Execute strSql, dbFailOnError
MsgBox db.RecordsAffected & " record(s) were updated."
Set db = Nothing
[Active] is a checkbox on the subform (fsubLOA) and YES/NO format on the
table CostSummarySheet. The code is on the On Click Event for [Active]. When
clicked I get:
"Too few parameters. Expected 2."
I am not a programmer. Any insight?
Thanks.
I am using Access 2003. I am trying to run an update query through VBA. My
SQL is this:
UPDATE CostSummarySheet SET CostSummarySheet.Active = Forms!fsubLOA!Active
WHERE (((CostSummarySheet.Proj_Name)=[Forms]![frmCSSheetEdit]![Proj_Name]));
and the code I am attempting to use is this:
Dim db As DAO.Database
Dim strSql As String
strSql = "UPDATE CostSummarySheet SET [Active] =
[Forms]![frmCSSheetEdit]![fsubLOA]![Active] WHERE [Proj_Name]=
[Forms]![frmCSSheetEdit]![Proj_Name];"
Set db = DBEngine(0)(0)
db.Execute strSql, dbFailOnError
MsgBox db.RecordsAffected & " record(s) were updated."
Set db = Nothing
[Active] is a checkbox on the subform (fsubLOA) and YES/NO format on the
table CostSummarySheet. The code is on the On Click Event for [Active]. When
clicked I get:
"Too few parameters. Expected 2."
I am not a programmer. Any insight?
Thanks.