Originariamente inviato da Dardino
Come dovrebbe essere:
codice:
If Data1.Recordset.RecordCount > 0 Then
    Data1.Recordset.MoveFirst
    If lblCerca.Caption = Data1.Recordset("Barre") Then
        MsgBox "OK"
    Else
        MsgBox "Assente"
    End If
End Sub
Per logica è corretto, ma non capisco xkè cmq non funge. Ho provato ad invertire la stringa if con

codice:
If lblcerca.caption <> Data1.Recordset("Barre") then
    MsgBox "Assente"
Else
    MsgBox "OK"
End If
e mi da lo stesso un bel vuoto nel caso in cui manca il codice a barre.