VBA DoCmd.OpenForm其中condition在数值之间

时间:2015-02-20 23:00:27

标签: vba

以下是我的命令,我无法获得数值

的语句之间的正确语法
Dim lowbsqft As Integer
Dim hibsqft As Integer


lowbsqft = Me.Building_Sqft - 500
hibsqft = Me.Building_Sqft + 500


DoCmd.OpenForm "Form1", , "HomeInfo", "[Subdivision]='" & Me.Subdivision & "' AND [Bedrooms]='" & Me.Bedrooms & "' AND [Building_Sqft] Between ' & lowbsqft & ' And ' & hibsqft & '"

真的很感激任何帮助

1 个答案:

答案 0 :(得分:0)

您需要正确插入简单引号",这应该有效:

DoCmd.OpenForm "Form1", , "HomeInfo", "[Subdivision]='" & Me.Subdivision & "' AND [Bedrooms]='" & Me.Bedrooms & "' AND [Building_Sqft] Between '" & lowbsqft & "' And '" & hibsqft & "'"