VERIFICAR DADOS ANTES DE GRAVAR

XXXANGELSXXX 06/10/2009 08:43:53
#324549
opa.. considere esse codigo por favor..

Private Sub Form_Load()
Data1.RecordSource = ([Ô]select * from movligacoes where MovStatus = [ô][Ô] & [Ô]Pendente[Ô] & [Ô][ô] and datainicio = #[Ô] & Format(MCalendario.Value, [Ô]mm/dd/yyyy[Ô]) & [Ô]# order by datainicio[Ô])
Data1.Refresh
End Sub

Private Sub MCalendario_DateClick(ByVal DateClicked As Date)
Data1.RecordSource = ([Ô]select * from movligacoes where MovStatus = [ô][Ô] & [Ô]Pendente[Ô] & [Ô][ô] and datainicio = #[Ô] & Format(MCalendario.Value, [Ô]mm/dd/yyyy[Ô]) & [Ô]# order by datainicio[Ô])
Data1.Refresh
End Sub

Private Sub Tool1_ButtonClick(ByVal ButtonIndex As Integer, ByVal ButtonKey As String)
Select Case ButtonIndex
Case 7
[ô]Inclusão de Registros
Data1.Recordset.AddNew
txtDInicial.Text = MCalendario.Value

With frmProcCli
.Tool1.ButtonVisible(7) = False
.Tool1.ButtonVisible(8) = False
.Tool1.ButtonVisible(9) = False
.Show 1
End With

Case 9
[ô]Gravar Registros
If txtColaborador.Text = Empty Then
txtStatus.Text = [Ô]Em Espera[Ô]
Else
txtStatus.Text = [Ô]Pendente[Ô]
End If
If txtColaborador.Text <> [Ô][Ô] And Text1.Text <> [Ô][Ô] Then

Data1.RecordSource = ([Ô]select * from movligacoes where MovStatus = [ô][Ô] & [Ô]Pendente[Ô] & [Ô][ô] and datainicio = #[Ô] & Format(MCalendario.Value, [Ô]mm/dd/yyyy[Ô]) & [Ô]# order by datainicio[Ô])
Data1.Refresh

if data1.recordset.RecordCount <> 0 Then
MsgBox [Ô]Já existe uma ocorrência cadastrada para este colaborador nesta hora![Ô], vbInformation, [Ô]Checkup Service[Ô]
txtHora.SetFocus: Exit Sub
else
txtAlocacao.Text = Format(Date, [Ô]dd/mm/yyyy[Ô]) & [Ô] - [Ô] & Format(Time, [Ô]hh:mm:ss[Ô])
Data1.Recordset.Update
End If
End If
End Select
End Sub
XXXANGELSXXX 08/10/2009 18:27:31
#324848
??
Página 2 de 2 [12 registro(s)]
Tópico encerrado , respostas não são mais permitidas