samedi 16 février 2019

Microsoft Access - IF statement

I want to make if statement using a text as a condition, in my field(Status_anggota) there is a combobox that has "Active" and "Not active" value. My problem is that it won't get the value of of the "Active" so it only show the false statement

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

Aucun commentaire:

Enregistrer un commentaire