VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmEstadisticas 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Estadisticas"
   ClientHeight    =   8385
   ClientLeft      =   4605
   ClientTop       =   3390
   ClientWidth     =   7860
   Icon            =   "frmEstadisticas.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   559
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   524
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton bBorrar 
      BackColor       =   &H000000FF&
      Caption         =   "BORRAR"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6000
      MaskColor       =   &H000000FF&
      Style           =   1  'Graphical
      TabIndex        =   25
      Top             =   7920
      Width           =   1695
   End
   Begin VB.CommandButton cmdPass 
      Caption         =   "CAMBIAR CONTRASEÑA"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   240
      TabIndex        =   24
      Top             =   7080
      Width           =   1695
   End
   Begin VB.CommandButton Command5 
      Appearance      =   0  'Flat
      BackColor       =   &H000000FF&
      Caption         =   "COPIA DE SEGURIDAD"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   450
      Left            =   8280
      MaskColor       =   &H008080FF&
      Style           =   1  'Graphical
      TabIndex        =   23
      Top             =   6840
      UseMaskColor    =   -1  'True
      Width           =   1695
   End
   Begin VB.CommandButton BORRAR2 
      Appearance      =   0  'Flat
      BackColor       =   &H000000FF&
      Caption         =   "COPIA DE SEGURIDAD"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   450
      Left            =   8040
      MaskColor       =   &H008080FF&
      Style           =   1  'Graphical
      TabIndex        =   20
      Top             =   7800
      UseMaskColor    =   -1  'True
      Width           =   1695
   End
   Begin VB.CommandButton Command4 
      Caption         =   ">"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   4680
      TabIndex        =   19
      Top             =   7920
      Width           =   1095
   End
   Begin VB.TextBox Text2 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Fixedsys"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   255
      Left            =   3600
      Locked          =   -1  'True
      MaxLength       =   5
      TabIndex        =   18
      Text            =   "0"
      Top             =   8040
      Width           =   855
   End
   Begin VB.CommandButton Command3 
      Caption         =   "<"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   2280
      TabIndex        =   16
      Top             =   7920
      Width           =   1095
   End
   Begin VB.TextBox TTicket 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Fixedsys"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   255
      Left            =   480
      Locked          =   -1  'True
      TabIndex        =   14
      Text            =   "0"
      Top             =   3840
      Width           =   1215
   End
   Begin VB.TextBox TFecha2 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Fixedsys"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   255
      Left            =   480
      Locked          =   -1  'True
      TabIndex        =   13
      Text            =   "0"
      Top             =   3120
      Width           =   1215
   End
   Begin VB.TextBox TFecha 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Fixedsys"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   255
      Left            =   480
      Locked          =   -1  'True
      TabIndex        =   12
      Text            =   "0"
      Top             =   2400
      Width           =   1215
   End
   Begin VB.Frame Frame4 
      Caption         =   "HASTA"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   240
      TabIndex        =   10
      Top             =   2880
      Width           =   1695
   End
   Begin VB.Frame Frame1 
      Caption         =   "DESDE"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   240
      TabIndex        =   9
      Top             =   2160
      Width           =   1695
   End
   Begin VB.CommandButton bImprtotal 
      Caption         =   "Imprimir Total"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1455
      Left            =   6000
      TabIndex        =   8
      Top             =   2640
      Width           =   1695
   End
   Begin VB.CommandButton bSalir 
      Height          =   1455
      Left            =   6000
      Picture         =   "frmEstadisticas.frx":0612
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   6120
      Width           =   1695
   End
   Begin VB.CommandButton Command2 
      Height          =   855
      Left            =   1080
      Picture         =   "frmEstadisticas.frx":112B
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   4320
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Height          =   855
      Left            =   240
      Picture         =   "frmEstadisticas.frx":18CD
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   4320
      Width           =   855
   End
   Begin VB.Frame Frame2 
      Caption         =   "TOTAL"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1815
      Left            =   240
      TabIndex        =   4
      Top             =   120
      Width           =   1935
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BackColor       =   &H8000000F&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial Black"
            Size            =   18
            Charset         =   0
            Weight          =   900
            Underline       =   -1  'True
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   120
         Locked          =   -1  'True
         TabIndex        =   15
         Text            =   "TOTAL"
         Top             =   240
         Width           =   1455
      End
      Begin VB.TextBox Text4 
         Appearance      =   0  'Flat
         BackColor       =   &H8000000F&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial Black"
            Size            =   18
            Charset         =   0
            Weight          =   900
            Underline       =   -1  'True
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   120
         Locked          =   -1  'True
         TabIndex        =   29
         Text            =   "BARRA"
         Top             =   720
         Width           =   1455
      End
      Begin VB.TextBox Text3 
         Appearance      =   0  'Flat
         BackColor       =   &H8000000F&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial Black"
            Size            =   18
            Charset         =   0
            Weight          =   900
            Underline       =   -1  'True
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   120
         Locked          =   -1  'True
         TabIndex        =   28
         Text            =   "MESAS"
         Top             =   1200
         Width           =   1455
      End
   End
   Begin VB.CommandButton bFecha 
      Caption         =   "Cambiar Fecha"
      Height          =   1695
      Left            =   240
      Picture         =   "frmEstadisticas.frx":208C
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   5280
      Width           =   1695
   End
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  'DefaultCursor
      DefaultType     =   2  'UseODBC
      Exclusive       =   0   'False
      Height          =   495
      Left            =   9120
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "TicketPrecio"
      Top             =   360
      Width           =   3135
   End
   Begin VB.CommandButton bImprimir 
      Caption         =   "Imprimir Lista"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1455
      Left            =   6000
      TabIndex        =   1
      Top             =   4440
      Width           =   1695
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   4575
      Left            =   2400
      TabIndex        =   0
      Top             =   2760
      Width           =   3255
      _ExtentX        =   5741
      _ExtentY        =   8070
      _Version        =   393216
      Rows            =   1
      FixedRows       =   0
      FixedCols       =   0
      BackColorFixed  =   16777215
      BackColorBkg    =   16777215
      GridColor       =   16777215
      GridColorFixed  =   16777215
      AllowBigSelection=   0   'False
      FocusRect       =   0
      HighLight       =   0
      SelectionMode   =   1
      BorderStyle     =   0
      Appearance      =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Fixedsys"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Frame Frame3 
      Caption         =   "TICKETS"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   240
      TabIndex        =   11
      Top             =   3600
      Width           =   1695
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid2 
      Height          =   4575
      Left            =   2400
      TabIndex        =   17
      Top             =   2760
      Width           =   3255
      _ExtentX        =   5741
      _ExtentY        =   8070
      _Version        =   393216
      Rows            =   1
      Cols            =   4
      FixedRows       =   0
      FixedCols       =   0
      BackColorFixed  =   16777215
      BackColorBkg    =   16777215
      GridColor       =   16777215
      GridColorFixed  =   16777215
      AllowBigSelection=   0   'False
      FocusRect       =   0
      HighLight       =   0
      SelectionMode   =   1
      BorderStyle     =   0
      Appearance      =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Fixedsys"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Line Line1 
      X1              =   16
      X2              =   512
      Y1              =   136
      Y2              =   136
   End
   Begin VB.Label lTotalComidaM 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   3720
      TabIndex        =   31
      Top             =   1680
      Width           =   1335
   End
   Begin VB.Label lTotalBebidaM 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   2280
      TabIndex        =   30
      Top             =   1680
      Width           =   1335
   End
   Begin VB.Label Label3 
      Caption         =   "Comida"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3720
      TabIndex        =   33
      Top             =   1440
      Width           =   1335
   End
   Begin VB.Label Label2 
      Caption         =   "Bebidas"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2280
      TabIndex        =   32
      Top             =   1440
      Width           =   1215
   End
   Begin VB.Label lTotalBarra 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   26.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   615
      Left            =   2280
      TabIndex        =   27
      Top             =   840
      Width           =   5415
   End
   Begin VB.Label lTotalMesas 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   26.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   615
      Left            =   5160
      TabIndex        =   26
      Top             =   1440
      Width           =   2535
   End
   Begin VB.Line Line2 
      X1              =   16
      X2              =   512
      Y1              =   520
      Y2              =   520
   End
   Begin VB.Label Label1 
      Caption         =   "Tickets:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   600
      TabIndex        =   22
      Top             =   7920
      Width           =   1095
   End
   Begin VB.Label lista 
      Caption         =   "Lista de productos"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2280
      TabIndex        =   21
      Top             =   2160
      Width           =   2655
   End
   Begin VB.Label LTotal 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   26.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   615
      Left            =   2280
      TabIndex        =   3
      Top             =   240
      Width           =   5415
   End
   Begin VB.Image Image1 
      Appearance      =   0  'Flat
      Height          =   6000
      Left            =   1800
      Picture         =   "frmEstadisticas.frx":2E8D
      Top             =   2160
      Width           =   4500
   End
End
Attribute VB_Name = "frmEstadisticas"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub bBorrar_Click()
Panel.Data1.Recordset.MoveFirst

Do Until Panel.Data1.Recordset.EOF

If Panel.Data1.Recordset![idticket] = Text2.Text Then

Panel.Data1.Recordset.Delete


End If

Panel.Data1.Recordset.MoveNext

Loop

'mostrar siguiente ticket
lista.Caption = "Tickets"

If Text2.Text < ticket - 1 Then

Text2.Text = Text2.Text + 1
recordarticket CLng(Text2.Text)
Else
Command4.Enabled = False
End If


End Sub

Private Sub bFecha_Click()
    frmFecha.Show
    frmFecha.MonthView1.Value = Date
    frmFecha.MonthView2.Value = Date
End Sub

Private Sub bImprimir_Click()
       Dim cantidad As String
        Dim nombre As String
        Dim imprimir As String
        Dim strtexto As String
        
        
       Open "COM3" For Output As #1
       
        If TFecha.Text = TFecha2.Text Then
            Print #1, "CANTIDAD VENDIDA "
            Print #1, "EL " & TFecha.Text
        Else
            Print #1, "CANTIDAD VENDIDA "
            Print #1, " DESDE " & TFecha.Text
            Print #1, " HASTA " & TFecha2.Text
        End If
        
        Print #1, "TOTAL TICKETS: " & TTicket.Text
        Print #1, "=========================="
        
        For I = 0 To frmEstadisticas.MSFlexGrid1.Rows - 1
            cantidad = frmEstadisticas.MSFlexGrid1.TextMatrix(I, 0)
            nombre = frmEstadisticas.MSFlexGrid1.TextMatrix(I, 1)
            
                    strtexto = nombre
        strtexto = Replace(strtexto, "á", "a")
        strtexto = Replace(strtexto, "é", "e")
        strtexto = Replace(strtexto, "í", "i")
        strtexto = Replace(strtexto, "ó", "o")
        strtexto = Replace(strtexto, "ú", "u")
        strtexto = Replace(strtexto, "Á", "A")
        strtexto = Replace(strtexto, "É", "E")
        strtexto = Replace(strtexto, "Í", "I")
        strtexto = Replace(strtexto, "Ó", "O")
        strtexto = Replace(strtexto, "Ú", "U")
        strtexto = Replace(strtexto, "Ñ", "N")
        strtexto = Replace(strtexto, "ñ", "n")
        nombre = strtexto
            

            imprimir = Space(6 - Len(cantidad)) & cantidad & "  " & nombre
            
            Print #1, imprimir
            imprimir = ""
        Next I
        
   
        Print #1, "=========================="
        Print #1, "TOTAL:   " & Space(10 - Len(LTotal.Caption)) & LTotal.Caption & " Euros"  'ticket 27
        Print #1, "=========================="

        Print #1, ""
        Print #1, " " & vbCrLf
        Print #1, Chr(27) & "d" & Chr$(5)
        Print #1, Chr(27) + Chr(105)
        Close #1
End Sub

Private Sub bImprtotal_Click()
Dim cantidad As String
        Dim nombre As String
        Dim imprimir As String
        Open "COM3" For Output As #1
        
        If TFecha.Text = TFecha2.Text Then
            Print #1, "TOTAL VENDIDO "
            Print #1, "EL " & TFecha.Text
        Else
            Print #1, "TOTAL VENDIDO "
            Print #1, " DESDE " & TFecha.Text
            Print #1, " HASTA " & TFecha2.Text
        End If
       
        Print #1, "==========================" ' 26 espacios
        Print #1, "TOTAL:   " & Space(10 - Len(LTotal.Caption)) & LTotal.Caption & " Euros"  'ticket 27
        Print #1, "BARRA:   " & Space(10 - Len(lTotalBarra.Caption)) & lTotalBarra.Caption & " Euros"  'ticket 27
        Print #1, "MESAS:   " & Space(10 - Len(lTotalMesas.Caption)) & lTotalMesas.Caption & " Euros"  'ticket 27
        Print #1, "Bebidas: " & Space(10 - Len(lTotalBebidaM.Caption)) & lTotalBebidaM.Caption & " Euros"  'ticket 27
        Print #1, "Comida:  " & Space(10 - Len(lTotalComidaM.Caption)) & lTotalComidaM.Caption & " Euros"  'ticket 27
        Print #1, "=========================="
        Print #1, ""
        Print #1, " " & vbCrLf
        Print #1, Chr(27) & "d" & Chr$(5)
        
        Print #1, Chr(27) + Chr(105)
        Close #1
End Sub





Private Sub bSalir_Click()
        Unload Me
End Sub

Private Sub cmdPass_Click()
frmCambiar.Show

End Sub

Private Sub Command1_Click()

     estadisticas (CDate(TFecha) - 1), (CDate(TFecha2) - 1)
End Sub

Private Sub Command2_Click()
    If CDate(TFecha) < Date Then
        estadisticas (CDate(TFecha) + 1), (CDate(TFecha2) + 1)
    End If
End Sub


Private Sub Command4_Click()
lista.Caption = "Tickets"

If Text2.Text < ticket - 1 Then

Text2.Text = Text2.Text + 1
recordarticket CLng(Text2.Text)
Else
Command4.Enabled = False

End If
End Sub



Private Sub Form_Load()
    Text2.Text = ticket ' - 1
   ' recordarticket CInt(Text2.Text)
End Sub


Private Sub Command3_Click()
Command4.Enabled = True
lista.Caption = "Tickets"

If Text2.Text > 1 Then

Text2.Text = Text2.Text - 1
recordarticket CLng(Text2.Text)
End If
End Sub



Private Sub LTotal_Change()
LTotal = Format(LTotal, "###0.00") '"###0.00")
End Sub

