Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
To precisando de mais essa ajuda.
já tentei de dois jeitos e os dois retornam que inclusao ocorreu, mas vou na tabela e os dados nao estao gravados.
Onde estou errando?????
Private Sub IncluirDados()
Dim vInclusao As Boolean
Dim vConfMsg As Integer
Dim vErro As Boolean
'inicializa as variaveis auxiliares'
vConfMsg = vbExclamation + vbOKOnly + vbSystemModal
vErro = False
'verifica os dados digitados'
If TxtNomeCliente.Text = Empty Then
MsgBox "O campo Nome não foi preenchido.", vConfMsg, "Erro"
vErro = True
End If
If TxtTel.Text = Empty Then
MsgBox "O campo Telefone não foi preenchido.", vConfMsg, "Erro"
vErro = True
End If
If TxtCidade.Text = Empty Then
MsgBox "O campo Cidade não foi preenchido.", vConfMsg, "Erro"
vErro = True
End If
If TxtDataInicioServico.Text = Empty Then
MsgBox "O campo Data Entrada não foi preenchido.", vConfMsg, "Erro"
vErro = True
End If
If TxtHoraInicioServico.Text = Empty Then
MsgBox "O campo Hora Entrada não foi preenchido.", vConfMsg, "Erro"
vErro = True
End If
If TxtProduto.Text = Empty Then
MsgBox "O campo Produto não foi preenchido.", vConfMsg, "Erro"
vErro = True
End If
If TxtMotivo.Text = Empty Then
MsgBox "O campo Motivo da Chamada não foi preenchido.", vConfMsg, "Erro"
vErro = True
End If
If TxtObs.Text = Empty Then
MsgBox "O campo Observação não foi preenchido.", vConfMsg, "Erro"
vErro = True
End If
'Se acontece um erro sai da sub sem gravar'
If vErro Then Exit Sub
With rsSelecao
If vInclusao = True Then
'identifica a operaçao como inclusão'
TxtNomeCliente.Text = !Nome
TxtTel.Text = Empty & !Telefone
TxtCidade.Text = !Cidade
TxtDataInicioServico.Text = !Data_Inicio_Servico
TxtHoraInicioServico.Text = !Hora_Inicio_Servico
TxtProduto.Text = !Produto
TxtMotivo.Text = Empty & !Motivo_Chamada
TxtObs.Text = Empty & !Obs
End If
End With
MsgBox "Inclusão ok", vbInformation + vbOKOnly + vbApplicationModal, "OK"
LimparTela
errGravacao:
With Err
If .Number <> 0 Then
MsgBox "Houve erro na inclusão dos dados na tabela.", vbExclamation + vbOKOnly + vbApplicationModal, "Erro"
.Number = 0
End If
End With
End Sub
fico no aguardo
nereu
Carregando comentários...