Private Sub cmdAltera_Click()
Adodc1.Recordset.AddNew
Adodc1.Refresh
End Sub

Private Sub cmdBack_Click()
If Adodc1.Recordset.BOF = True Then
Adodc1.Recordset.MoveLast
Else
Adodc1.Recordset.MovePrevious
End If
End Sub

Private Sub cmdCadastra_Click()



cmdCadastra.Visible = False
cmdOK.Visible = True

End Sub

Private Sub cmdExclui_Click()
Adodc1.Recordset.Delete
Adodc1.Refresh
MsgBox "Registro Excluido", vbOKOnly, "Excluir"
End Sub

Private Sub cmdExit_Click()
Adodc1.Recordset.Close
MsgBox "Vagner.Rodrigues@Estadao.Com.Br", vbInformation, "By Vagner"
End
End Sub

Private Sub cmdNext_Click()
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MoveFirst
Else
Adodc1.Recordset.MoveNext
End If
End Sub

Private Sub cmdOK_Click()
cmdOK.Visible = False
cmdCadastra.Visible = True
Adodc1.Recordset.AddNew
End Sub

Private Sub cmdProcura_Click()
Dim NomeProcura As Variant
NomeProcura = InputBox("Nome:", "Procurar")

End Sub

Private Sub Form_Load()
Form1.Caption = "Banco De Dados Do Vagner"
Adodc1.Visible = False
lblNome.Caption = "Nome:"
lblNome.AutoSize = True
lblIdade.Caption = "Idade:"
lblIdade.AutoSize = True
lblEstadoC.Caption = "Est Civil"
lblEstadoC.AutoSize = True
cmdExit.Caption = "Sair"
cmdCadastra.Caption = "Cadastrar"
cmdOK.Caption = "OK?"
cmdOK.Visible = False
cmdExclui.Caption = "Excluir"
cmdAltera.Caption = "Alterar"
txtNome.TabIndex = 0
txtIdade.TabIndex = 1
txtEstadoC.TabIndex = 2
cmdBack.TabIndex = 3
cmdNext.TabIndex = 4
cmdCadastra.TabIndex = 5
cmdExit.TabIndex = 6
cmdAltera.TabIndex = 7
cmdExclui.TabIndex = 8
cmdSalva.TabIndex = 9
cmdProcura.TabIndex = 10
txtNome.Locked = True
txtIdade.Locked = True
txtEstadoC.Locked = True
cmdSalva.Caption = "Salvar"
cmdProcura.Caption = "Procurar"

If txtIdade.Text = txtIdade Then
txtIdade.Text = ""
End If

If txtNome.Text = txtNome Then
txtNome.Text = ""
End If

If txtEstadoC.Text = txtEstadoC Then
txtEstadoC.Text = ""
End If

With Adodc1
    .ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=false;Data Source=C:\Meus documentos\BD_Vagner\BD1.mdb"
    .CommandType = adCmdTable
    .RecordSource = "Vagner1"
End With

    Set txtNome.DataSource = Adodc1
    txtNome.DataField = "Nome"
    
    Set txtIdade.DataSource = Adodc1
    txtIdade.DataField = "Idade"

    Set txtEstadoC.DataSource = Adodc1
    txtEstadoC.DataField = "EstadoC"

cmdBack.Caption = "<<"
cmdNext.Caption = ">>"

End Sub
