Dim BCO As Database
Dim TAB1 As Recordset
Dim TAB2 As Recordset
Dim TAB3 As Recordset
Set BCO = CurrentDb()
Set TAB1 = BCO.OpenRecordset("TAB1")
Set TAB2 = BCO.OpenRecordset("TAB2")
Set TAB3 = BCO.OpenRecordset("TAB3")
If Me.PagoSeguro > 0 Then
TAB1.AddNew
TAB1![campo1] = Me.DataC
TAB1![campo2] = Me.SeguroC
TAB1![campo3] = Me.MedicoC
TAB1![campo4] = Me.PagoSeguro
TAB1![campo5] = Me.ChequeDentistaNº
End If
If Me.PagoUtente > 0 And Me.TipoPagamentoC <> "3" Then
TAB2.AddNew
TAB2![campo1] = Me.DataC
TAB2![campo2] = Me.SeguroC
TAB2![campo3] = Me.MedicoC
TAB2![campo4] = Me.CaixaC
TAB2![campo5] = Me.PacienteC
End If
If Me.PagoUtente > 0 And Me.TipoPagamentoC = "3" Then
TAB3.AddNew
TAB3![campo1] = Me.DataC
TAB3![campo2] = Me.SeguroC
TAB3![campo3] = Me.MedicoC
TAB3![campo4] = Me.CaixaC
TAB3![campo5] = Me.PacienteC
End If
If MsgBox("Confirma a Inclusão dos Dados", vbYesNo, "Titulo") = vbYes Then
TAB1.Update
TAB2.Update
TAB3.Update
Else
TAB1.CancelUpdate
TAB2.CancelUpdate
TAB3.CancelUpdate
End If
TAB1.Close
TAB2.Close
TAB3.Close
Dim TAB1 As Recordset
Dim TAB2 As Recordset
Dim TAB3 As Recordset
Set BCO = CurrentDb()
Set TAB1 = BCO.OpenRecordset("TAB1")
Set TAB2 = BCO.OpenRecordset("TAB2")
Set TAB3 = BCO.OpenRecordset("TAB3")
If Me.PagoSeguro > 0 Then
TAB1.AddNew
TAB1![campo1] = Me.DataC
TAB1![campo2] = Me.SeguroC
TAB1![campo3] = Me.MedicoC
TAB1![campo4] = Me.PagoSeguro
TAB1![campo5] = Me.ChequeDentistaNº
End If
If Me.PagoUtente > 0 And Me.TipoPagamentoC <> "3" Then
TAB2.AddNew
TAB2![campo1] = Me.DataC
TAB2![campo2] = Me.SeguroC
TAB2![campo3] = Me.MedicoC
TAB2![campo4] = Me.CaixaC
TAB2![campo5] = Me.PacienteC
End If
If Me.PagoUtente > 0 And Me.TipoPagamentoC = "3" Then
TAB3.AddNew
TAB3![campo1] = Me.DataC
TAB3![campo2] = Me.SeguroC
TAB3![campo3] = Me.MedicoC
TAB3![campo4] = Me.CaixaC
TAB3![campo5] = Me.PacienteC
End If
If MsgBox("Confirma a Inclusão dos Dados", vbYesNo, "Titulo") = vbYes Then
TAB1.Update
TAB2.Update
TAB3.Update
Else
TAB1.CancelUpdate
TAB2.CancelUpdate
TAB3.CancelUpdate
End If
TAB1.Close
TAB2.Close
TAB3.Close