Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 更新查询不使用Access更新表中的值_Sql_Ms Access_Vba - Fatal编程技术网

Sql 更新查询不使用Access更新表中的值

Sql 更新查询不使用Access更新表中的值,sql,ms-access,vba,Sql,Ms Access,Vba,我正在尝试运行一个简单的更新查询,它应该从表单中获取一个值并更新一个已经存在的表。这是使用VBA完成的。执行时不会显示错误消息,但不会使用NI的新值更新表。代码如下 strsql = "UPDATE t_datefromform SET " strsql = strsql & "[txtmonth] = '" & [Forms]![SupplierScorecard].[txtMonth] & "'" Debug.Print strsql Cu

我正在尝试运行一个简单的更新查询,它应该从表单中获取一个值并更新一个已经存在的表。这是使用VBA完成的。执行时不会显示错误消息,但不会使用NI的新值更新表。代码如下

   strsql = "UPDATE t_datefromform SET "
   strsql = strsql & "[txtmonth] = '" & [Forms]![SupplierScorecard].[txtMonth] & "'"

   Debug.Print strsql

   CurrentDb.Execute strsql

set[txtmount]是一个输入参数 使用
strsql=“Update t_datefromform set txtmount=”&[Forms]![供应商记分卡].[txtmount]&“'”

请向我们显示Debug.Print的输出!在向我们展示了Debug.Print的输出之后,请告诉我们,同一个SQL字符串在VBA之外是否工作良好——换句话说,作为查询设计界面中“手动”运行的查询对象的基础。Debug.Print语句的输出是UPDATE t_datefromform SET[txtmount]='Oct-2012'SQL字符串在VBA之外也不工作,即手动运行时,[TXTMOUNT]是什么数据类型?