【发布时间】:2019-07-10 07:17:43
【问题描述】:
我想使用一些文本作为条件构造一个if 语句。
在我的字段Status_anggota 中有一个组合框,其值为"Active" 或"Not active"。
我的问题是它不会得到"Active" 的值,所以它只显示错误的声明:
Set db = CurrentDb()
Set rs = db.OpenRecordset("Select Status_anggota from Tbl_anggota Where Kode_anggota='" & Text2 & "'")
If rs.RecordCount = "Active" Then
MsgBox "Status is active", vbInformation
Else
MsgBox "Status is not active", vbInformation
End If
【问题讨论】:
-
RecordCount 是一个数字。
标签: database ms-access if-statement vba