尝试:
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中传递不带引号的字符串变量
尝试:
Dim StoreNoToUpdate As String
Dim Marsha As String
StoreNoToUpdate = "ABCXYZ123"
Marsha = "hi"
Db.Execute "Update TblLodgingReport set [MarshaCode]='" & Marsha & "'where [Store Number ID]= 'ABCXYZ123'"