Pessoal, tem como Listar, comparar e extrair dados de Tabela via VBA no Access, como se faz no PHP, tipo:
===== código =====
Private Sub SearchCaso_Click()
On Error Resume Next
Me.txtAnoE.SetFocus
Dim I As Long
Dim rss As DAO.Recordset
Set rss = CurrentDb.OpenRecordset("SELECT * FROM Casos WHERE [Controle]=" & Me!txtControleE.Value, dbOpenDynaset)
For I = 0 To rss.Fields.Count - 1
If rss("Controle").Value = Me!txtControleE.Value Then
Me.txtGeralE.Enabled = True
Me.txtGeralE.Value = [RedeGeral]
Exit Sub
Else
MsgBox "Nenhum dado encontrado!", vbCritical, "Aviso"
Me.txtGeralE.Enabled = False
Exit Sub
End If
End Sub
=====================
Desde já agradeço, Paz e Luz
===== código =====
Private Sub SearchCaso_Click()
On Error Resume Next
Me.txtAnoE.SetFocus
Dim I As Long
Dim rss As DAO.Recordset
Set rss = CurrentDb.OpenRecordset("SELECT * FROM Casos WHERE [Controle]=" & Me!txtControleE.Value, dbOpenDynaset)
For I = 0 To rss.Fields.Count - 1
If rss("Controle").Value = Me!txtControleE.Value Then
Me.txtGeralE.Enabled = True
Me.txtGeralE.Value = [RedeGeral]
Exit Sub
Else
MsgBox "Nenhum dado encontrado!", vbCritical, "Aviso"
Me.txtGeralE.Enabled = False
Exit Sub
End If
End Sub
=====================
Desde já agradeço, Paz e Luz