Private Sub BotonImprimir_Click()
   Dim Ok As Byte
   Dim msg As String
   Dim Cliente, Factura, x As Integer
   
   Dim GAREMPN As Database
   Dim RegEmpn As Recordset
   
  msg = "Confirma el Proceso de Limpieza de Archivos? "
  Ok = MsgBox(msg, 4 + 48, "AYUDA: Limpieza de Cta. Cte")
  If Ok = 6 Then
     Set GAREMPN = DBEngine.Workspaces(0).Databases(0)
     Set RegEmpn = GAREMPN.OpenRecordset("GAREMPN", DB_OPEN_TABLE)
     RegEmpn.Index = "IdCliMov"
     RegEmpn.MoveNext
     Do Until RegEmpn.EOF
        If RegEmpn!NivelMov = 0 And RegEmpn!SaldoMov = 0 And RegEmpn!FechaMov = Me![FechaLimpieza] Then
           Cliente = RegEmpn!IdCliMov
           Factura = RegEmpn!FacturaMov
           Do While Cliente = RegEmpn!IdCliMov And Factura = RegEmpn!FacturaMov
              RegEmpn.Delete
              x = x + 1
              RegEmpn.MoveNext
           Loop
        End If
        If RegEmpn!SaldoMov < 0.009999999999999 Then
           RegEmpn.Edit
           RegEmpn!SaldoMov = 0#
           RegEmpn.Update
        End If
        RegEmpn.MoveNext
     Loop
     GAREMPN.Close: RegEmpn.Close
     msg = "Ud. ha Borrado " & x & " facturas, con sus correspondientes pagos"
     MsgBox (msg), (vbOKOnly), ("AYUDA: Limpieza de Cta. Cte")
  End If
  DoCmd.Close
End Sub
