本文介绍了在查询VBA中传递不带引号的字符串变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dim StoreNoToUpdate As String
Dim Marsha As String

StoreNoToUpdate = "ABCXYZ123"

Marsha = "hi"

db.Execute "Update TblLodgingReport set [MarshaCode]=  'Marsha'  where [Store Number ID]= 'ABCXYZ123'"

我正在尝试在"ABCXYZ123"位置更新"hi".但不粘贴"hi",而是粘贴"Marsha".

I am trying to update "hi" at "ABCXYZ123" location. but its not pasting "hi", instead its pasting "Marsha".

推荐答案

尝试:

Dim StoreNoToUpdate As String
Dim Marsha As String

StoreNoToUpdate = "ABCXYZ123"

Marsha = "hi"

Db.Execute "Update TblLodgingReport set [MarshaCode]='" & Marsha & "'where [Store Number ID]= 'ABCXYZ123'"

这篇关于在查询VBA中传递不带引号的字符串变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 05:48