Public Function ConfirmarRegisto(ByVal strIdentificativo As String, ByVal strCodigo As Long) As Boolean
Set rstMovimentos = New ADODB.Recordset
strSql = "SELECT id_movimento, Codigo FROM tMovimentos"
strSql = strSql & " WHERE tMOVIMENTOS.id_movimento ='" & strIdentificativo & "'"
strSql = strSql & " and tMOVIMENTOS.Codigo = " & strCodigo & ""
rstMovimentos.CursorLocation = adUseClient
rstMovimentos.Open strSql, dbDados, adOpenKeyset, adLockReadOnly, adCmdText
If Not rstMovimentos.EOF Then
ConfirmarRegisto = True
Else
ConfirmarRegisto = False
End If
rstMovimentos.Close
Set rstMovimentos = Nothing
End Function
Logo você gera a mensagem de acordo com a resposta recebida.