寻找vba代码的查询语法,以便查找是/否字段=否。
Set rsStepCalendar = db.OpenRecordset("Select * from tblStepCalendar" & _
"Where (groupNr like '*" & txtGroupNum.Value & "*' )" & _
"AND (CanceledContact = 0)", dbOpenDynaset)
答案 0 :(得分:2)
如果您的SQL语句准确无误,则以下内容应该有效。
Dim strSQL AS String
Dim db AS DAO.Database
Dim rsStepCalendar AS DAO.Recordset
strSQL = "SELECT" & VbCrLf & _
" S.*" & VbCrLf & _
"FROM tblStepCalendar S" & VbCrLf & _
"WHERE S.groupNr LIKE '*" & txtGroupNum.Value & "*'" & VbCrLf & _
"AND S.CanceledContact = 0"
Set db = CurrentDB
Set rsStepCalendar = db.OpenRecordset(strSQL, dbOpenDynaset)