RaouL_BennetH
05-12-2004, 13:22
questo è il codice:
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "Digitare un codice" & vbOK
Else
rsql = ""
rsql = rsql & "SELECT * FROM tblpresenze WHERE tblpresenze.codmar LIKE '" & Text1.Text & "' ORDER BY marcatura"
Set rs = cn.Execute(rsql)
While Not (rs.EOF)
flex2.ColWidth(0) = 1290
flex2.Text = "CODICE LETTO"
flex2.ColWidth(1) = 3000
flex2.Text = "ORARIO MARCATURA"
flex2.AddItem rs("codmar") & vbTab & rs("marcatura")
rs.MoveNext
Wend
End If
End Sub
Mi servirebbe capire come fare quando inserisco un codice che nel database non c'è, in modo che il programma mi dia il messaggio in un msgbox tipo "Record non trovato".
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "Digitare un codice" & vbOK
Else
rsql = ""
rsql = rsql & "SELECT * FROM tblpresenze WHERE tblpresenze.codmar LIKE '" & Text1.Text & "' ORDER BY marcatura"
Set rs = cn.Execute(rsql)
While Not (rs.EOF)
flex2.ColWidth(0) = 1290
flex2.Text = "CODICE LETTO"
flex2.ColWidth(1) = 3000
flex2.Text = "ORARIO MARCATURA"
flex2.AddItem rs("codmar") & vbTab & rs("marcatura")
rs.MoveNext
Wend
End If
End Sub
Mi servirebbe capire come fare quando inserisco un codice che nel database non c'è, in modo che il programma mi dia il messaggio in un msgbox tipo "Record non trovato".