Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Bilancio familiare - frmMain.frm

frmMain.frm

Caricato da: Roberto VB
Scarica il programma completo

  1. Option Explicit
  2.  
  3. 'OGNI TEXTBOX HA DEL CODICE NELL'EVENTO LOSTFOCUS E GOTFOCUS.
  4. 'QUEL CODICE SERVE A FAR CANCELLARE LO 0 QUANDO UN UTENTE
  5. 'CLICCA SULLA CASELLA. QUALORA NELLA CASELLA VIENE AGGIUNTO
  6. 'UN VALORE DIVERSO DA 0, NATURALMENTE NON VIENE AZZERATA
  7.  
  8. 'VARIABILI PER USCITE FISSE
  9.     Dim Gas As Double
  10.     Dim Telefono As Double
  11.     Dim Acqua As Double
  12.     Dim Spazzatura As Double
  13.     Dim Enel As Double
  14.     Dim SKY As Double
  15.     Dim Giornali As Double
  16.     Dim Assicurazione As Double
  17.     Dim Condominio As Double
  18.     Dim Mutuo As Double
  19.     Dim Finanziamento As Double
  20.     Dim Pensione As Double
  21.     Dim Macchina As Double
  22.     Dim Benzina As Double
  23.     Dim ADSL As Double
  24.     Dim Ricariche As Double
  25.     'VARIABILI PER USCITE VARIE
  26.     Dim Alimenti As Double
  27.     Dim Vestiario As Double
  28.     Dim Lusso As Double
  29.     Dim Regali As Double
  30.     Dim Medicine As Double
  31.     Dim Casa As Double
  32.     Dim Meccanico As Double
  33.     Dim Viaggi As Double
  34.     Dim Scuola As Double
  35.     Dim Universita As Double
  36.     Dim RAI As Double
  37.     Dim ExtraUsciteVariabili As Double
  38.     Dim ExtraUscite As Double
  39.     'VARIABILI PER ENTRATE
  40.     Dim StipendioMarito As Double
  41.     Dim StipendioMoglie
  42.     Dim Fondi As Double
  43.     Dim Extra As Double
  44.     'VARIABILE CHE CONTIENE IL NUMERO
  45.     'DELLE OPERAZIONI EFFETTUATE
  46.     Dim Conta As Integer
  47.  
  48.  
  49. Private Sub Form_Activate()
  50.     'Chiudo tutti i file aperti
  51.     Close
  52. End Sub
  53.  
  54. Private Sub Form_Load()
  55.     Conta = 0
  56. End Sub
  57.  
  58.  
  59.  
  60. Private Sub mnuFileCalcola_Click()
  61. On Error GoTo GestioneErrori
  62.     'VARIABILI PER IL TOTALE
  63.     Dim Guadagni As Double
  64.     Dim Spese As Double
  65.     Dim Totale As Currency
  66.     assegna
  67.     'Calcolo il totale
  68.     Guadagni = StipendioMarito + StipendioMoglie + Fondi + Extra
  69.     Spese = Gas + Telefono + Acqua + Spazzatura + Enel + SKY + Giornali + Assicurazione + Condominio + Mutuo + Finanziamento + Pensione + Macchina + Benzina + ADSL + Ricariche + ExtraUscite + Alimenti + Vestiario + Lusso + Regali + Medicine + Casa + Meccanico + Viaggi + Scuola + Universita + RAI + ExtraUsciteVariabili
  70.     Totale = Guadagni - Spese
  71.     'Se totale va in nagativo, allora viene segnalato in rosso;
  72.     'altrimenti non accade nulla
  73.     If Totale < 0 Then
  74.         With lblTot
  75.             .Caption = Totale
  76.             .ForeColor = vbRed
  77.         End With
  78.     ElseIf Totale > 0 Then
  79.         With lblTot
  80.             .Caption = Totale
  81.             .ForeColor = vbBlue
  82.         End With
  83.     End If
  84.     'Assegno il valore del Totale alla label
  85.     lblTot.Caption = Format$(Totale, "Currency")
  86.     Conta = Conta + 1
  87.     lblOperazioni = Conta
  88.     Exit Sub
  89. GestioneErrori:
  90.     MsgBox Err.Description, vbExclamation, "ERRORE!"
  91.  
  92. End Sub
  93.  
  94. Private Sub assegna()
  95.     'Assegno un valore ad ogni variabile
  96.     'Utilizzo "val" per tasformare le textbox (che restituiscono stringhe)
  97.     'in double
  98.     Gas = Val(txtGas.Text)
  99.     Telefono = Val(txtTelefono.Text)
  100.     Acqua = Val(txtAcqua.Text)
  101.     Spazzatura = Val(txtSpazzatura.Text)
  102.     Enel = Val(txtEnel.Text)
  103.     SKY = Val(txtSKY.Text)
  104.     Giornali = Val(txtGiornali.Text)
  105.     Assicurazione = Val(txtAssicurazione.Text)
  106.     Condominio = Val(txtCondominio.Text)
  107.     Mutuo = Val(txtMutuo.Text)
  108.     Finanziamento = Val(txtFinanziamento.Text)
  109.     Pensione = Val(txtPensione.Text)
  110.     Macchina = Val(txtMacchina.Text)
  111.     Benzina = Val(txtBenzina.Text)
  112.     ADSL = Val(txtADSL.Text)
  113.     Ricariche = Val(txtRicariche.Text)
  114.     ExtraUscite = Val(txtExtraUscite.Text)
  115.     Alimenti = Val(txtAlimenti.Text)
  116.     Vestiario = Val(txtVestiario.Text)
  117.     Lusso = Val(txtBeni.Text)
  118.     Regali = Val(txtRegali.Text)
  119.     Medicine = Val(txtMedicine.Text)
  120.     Casa = Val(txtCasa.Text)
  121.     Meccanico = Val(txtMeccanico.Text)
  122.     Viaggi = Val(txtViaggi.Text)
  123.     Scuola = Val(txtScuola.Text)
  124.     Universita = Val(txtUniversita.Text)
  125.     RAI = Val(txtRAI.Text)
  126.     ExtraUsciteVariabili = Val(txtExtraUsciteVariabili.Text)
  127.     StipendioMarito = Val(txtStipendioMarito.Text)
  128.     StipendioMoglie = Val(txtStipendioMoglie.Text)
  129.     Fondi = Val(txtFondi.Text)
  130.     Extra = Val(txtExtra.Text)
  131. End Sub
  132. Private Sub mnuFileConfronto_Click()
  133.     colore_sfondo
  134.     frmConfronto.Show 1
  135. End Sub
  136.  
  137. Private Sub mnuFileEsci_Click()
  138.     Dim answer As Integer
  139.     answer = MsgBox("Sei sicuro di voler uscire?", vbExclamation + vbYesNo + vbDefaultButton2, "EXIT")
  140.     If answer = vbYes Then
  141.         'Se il contatore delle operazioni effettuate
  142.         'è maggiore di 0, vuol dire che l'utente ha fatto qualche operazione
  143.         'Per cui consiglio di salvare il bilancio prima di chiudere
  144.         If Conta > 0 Then
  145.             answer = MsgBox("Desideri salvare i calcoli effettuati?", vbExclamation + vbYesNo + vbDefaultButton2, "SALVATAGGIO")
  146.                 If answer = vbYes Then
  147.                     mnuFileSalva_Click
  148.                 Else
  149.                     End
  150.                 End If
  151.         End If
  152.         'Termino il programma
  153.         End
  154.     Else
  155.         Exit Sub
  156.     End If
  157. End Sub
  158.  
  159. Private Sub mnuFileMenu_Click()
  160.     frmMenu.Show
  161.     Unload Me
  162. End Sub
  163.  
  164. Private Sub mnuFileNuova_Click()
  165.     'Disattivo la voce del menu
  166.     mnuModificaValori.Enabled = False
  167.     mnuModificaAzzera.Enabled = False
  168.     Azzera
  169.  
  170.  
  171.  
  172. End Sub
  173. Private Sub Azzera()
  174. On Error Resume Next
  175.     Dim i As Integer
  176.     'Azzero tutte le textbox
  177.     For i = 0 To Controls.Count - 1
  178.     Controls(i).Text = "0"
  179.     Next
  180.     lblTot.ForeColor = vbBlack
  181.     txtGas.SetFocus
  182.     lblRiepilogo.Visible = False
  183. End Sub
  184.  
  185.  
  186. Private Sub mnuFileSalva_Click()
  187.     Dim Testo As String
  188.     Dim answer As Integer
  189.     Dim a As Integer
  190.     a = FreeFile
  191.     answer = MsgBox("Desideri salvare i seguenti dati?", vbExclamation + vbYesNo, "SALVATAGGIO")
  192.     If answer = vbYes Then
  193.         assegna
  194.         Testo = txtGas.Text & ":" & txtTelefono.Text & ":" & _
  195.                 txtAcqua.Text & ":" & txtSpazzatura.Text & ":" & _
  196.                 txtEnel.Text & ":" & txtSKY.Text & ":" & _
  197.                 txtGiornali.Text & ":" & txtAssicurazione.Text & ":" & _
  198.                 txtCondominio.Text & ":" & txtMutuo.Text & ":" & _
  199.                 txtFinanziamento.Text & ":" & txtPensione.Text & ":" & _
  200.                 txtMacchina.Text & ":" & txtBenzina.Text & ":" & _
  201.                 txtADSL.Text & ":" & txtRicariche.Text & ":" & _
  202.                 txtExtraUscite.Text & ":" & txtAlimenti.Text & ":" & _
  203.                 txtVestiario.Text & ":" & txtBeni.Text & ":" & _
  204.                 txtRegali.Text & ":" & txtMedicine.Text & ":" & _
  205.                 txtCasa.Text & ":" & txtMeccanico.Text & ":" & _
  206.                 txtViaggi.Text & ":" & txtScuola.Text & ":" & _
  207.                 txtUniversita.Text & ":" & txtRAI.Text & ":" & _
  208.                 txtExtraUsciteVariabili.Text & ":" & txtStipendioMarito.Text & ":" & _
  209.                 txtStipendioMoglie.Text & ":" & txtFondi.Text & ":" & _
  210.                 txtExtra.Text
  211.                
  212.                 'COSI CREO UN FILE PER OGNI MESE
  213.         Open App.Path & "\" & Month(Now) & "-" & Year(Now) & "-Temp.dat" For Random As a
  214.             Put a, 1, Testo
  215.         Close a
  216.         MsgBox "File salvato con successo!", vbOKOnly, "SALVATAGGIO"
  217.         Conta = 0
  218.         lblOperazioni.Caption = Conta
  219.     Else
  220.         Exit Sub
  221.     End If
  222. End Sub
  223.  
  224. Private Sub mnuHelpGuida_Click()
  225.     colore_sfondo
  226.     frmGuida.Show
  227. End Sub
  228.  
  229. Private Sub mnuHelpInfo_Click()
  230.     colore_sfondo
  231.     frmAbout.Show
  232. End Sub
  233.  
  234. Private Sub mnuModificaAzzera_Click()
  235.     Dim Testo As String
  236.     Dim answer As Integer
  237.     answer = MsgBox("Sei sicuro di voler azzerare tutti i valori?", vbExclamation + vbYesNo, "ELIMINA")
  238.     If answer = vbYes Then
  239.        
  240.         Azzera
  241.        
  242.         Testo = txtGas.Text & ":" & txtTelefono.Text & ":" & _
  243.                 txtAcqua.Text & ":" & txtSpazzatura.Text & ":" & _
  244.                 txtEnel.Text & ":" & txtSKY.Text & ":" & _
  245.                 txtGiornali.Text & ":" & txtAssicurazione.Text & ":" & _
  246.                 txtCondominio.Text & ":" & txtMutuo.Text & ":" & _
  247.                 txtFinanziamento.Text & ":" & txtPensione.Text & ":" & _
  248.                 txtMacchina.Text & ":" & txtBenzina.Text & ":" & _
  249.                 txtADSL.Text & ":" & txtRicariche.Text & ":" & _
  250.                 txtExtraUscite.Text & ":" & txtAlimenti.Text & ":" & _
  251.                 txtVestiario.Text & ":" & txtBeni.Text & ":" & _
  252.                 txtRegali.Text & ":" & txtMedicine.Text & ":" & _
  253.                 txtCasa.Text & ":" & txtMeccanico.Text & ":" & _
  254.                 txtViaggi.Text & ":" & txtScuola.Text & ":" & _
  255.                 txtUniversita.Text & ":" & txtRAI.Text & ":" & _
  256.                 txtExtraUsciteVariabili.Text & ":" & txtStipendioMarito.Text & ":" & _
  257.                 txtStipendioMoglie.Text & ":" & txtFondi.Text & ":" & _
  258.                 txtExtra.Text
  259.                
  260.                 'COSI CREO UN FILE PER OGNI MESE
  261.         Open App.Path & "\" & Month(Now) & "-" & Year(Now) & ".dat" For Random As #1
  262.             Put #1, 1, Testo
  263.         Close #1
  264.         MsgBox "File salvato con successo!", vbOKOnly, "SALVATAGGIO"
  265.     Else
  266.         Exit Sub
  267.     End If
  268. End Sub
  269.  
  270. Private Sub mnuModificaValori_Click()
  271.     Dim Testo As String
  272.     Dim answer As Integer
  273.     answer = MsgBox("Desideri apportare le seguenti modifiche ai dati?", vbExclamation + vbYesNo, "SALVATAGGIO")
  274.     If answer = vbYes Then
  275.        
  276.         Testo = txtGas.Text & ":" & txtTelefono.Text & ":" & _
  277.                 txtAcqua.Text & ":" & txtSpazzatura.Text & ":" & _
  278.                 txtEnel.Text & ":" & txtSKY.Text & ":" & _
  279.                 txtGiornali.Text & ":" & txtAssicurazione.Text & ":" & _
  280.                 txtCondominio.Text & ":" & txtMutuo.Text & ":" & _
  281.                 txtFinanziamento.Text & ":" & txtPensione.Text & ":" & _
  282.                 txtMacchina.Text & ":" & txtBenzina.Text & ":" & _
  283.                 txtADSL.Text & ":" & txtRicariche.Text & ":" & _
  284.                 txtExtraUscite.Text & ":" & txtAlimenti.Text & ":" & _
  285.                 txtVestiario.Text & ":" & txtBeni.Text & ":" & _
  286.                 txtRegali.Text & ":" & txtMedicine.Text & ":" & _
  287.                 txtCasa.Text & ":" & txtMeccanico.Text & ":" & _
  288.                 txtViaggi.Text & ":" & txtScuola.Text & ":" & _
  289.                 txtUniversita.Text & ":" & txtRAI.Text & ":" & _
  290.                 txtExtraUsciteVariabili.Text & ":" & txtStipendioMarito.Text & ":" & _
  291.                 txtStipendioMoglie.Text & ":" & txtFondi.Text & ":" & _
  292.                 txtExtra.Text
  293.                
  294.                 'COSI CREO UN FILE PER OGNI MESE
  295.         Open App.Path & "\" & Month(Now) & "-" & Year(Now) & ".dat" For Random As #1
  296.             Put #1, 1, Testo
  297.         Close #1
  298.         MsgBox "File salvato con successo!", vbOKOnly, "SALVATAGGIO"
  299.     Else
  300.         Exit Sub
  301.     End If
  302.  
  303. End Sub
  304.  
  305. Private Sub mnuStrumentiMutuo_Click()
  306.     colore_sfondo
  307.     frmMutuo.Show vbModal
  308. End Sub
  309.  
  310. Private Sub mnuVisualizzaEspandi_Click()
  311.     'MODIFICO LE DIMENSIONI DELLE CASELLE DI TESTO
  312.     txtGas.Width = 1400
  313.     txtTelefono.Width = 1400
  314.     txtAcqua.Width = 1400
  315.     txtSpazzatura.Width = 1400
  316.     txtEnel.Width = 1400
  317.     txtSKY.Width = 1400
  318.     txtGiornali.Width = 1400
  319.     txtAssicurazione.Width = 1400
  320.     txtCondominio.Width = 1400
  321.     txtMutuo.Width = 1400
  322.     txtFinanziamento.Width = 1400
  323.     txtPensione.Width = 1400
  324.     txtMacchina.Width = 1400
  325.     txtBenzina.Width = 1400
  326.     txtADSL.Width = 1400
  327.     txtRicariche.Width = 1400
  328.     txtExtraUscite.Width = 1400
  329.     txtAlimenti.Width = 1400
  330.     txtVestiario.Width = 1400
  331.     txtBeni.Width = 1400
  332.     txtRegali.Width = 1400
  333.     txtMedicine.Width = 1400
  334.     txtCasa.Width = 1400
  335.     txtMeccanico.Width = 1400
  336.     txtViaggi.Width = 1400
  337.     txtScuola.Width = 1400
  338.     txtUniversita.Width = 1400
  339.     txtRAI.Width = 1400
  340.     txtExtraUsciteVariabili.Width = 1400
  341.     txtStipendioMarito.Width = 1400
  342.     txtStipendioMoglie.Width = 1400
  343.     txtFondi.Width = 1400
  344.     txtExtra.Width = 1400
  345.  
  346. End Sub
  347.  
  348. Private Sub mnuVisualizzaRiduci_Click()
  349.     txtGas.Width = 795
  350.     txtTelefono.Width = 795
  351.     txtAcqua.Width = 795
  352.     txtSpazzatura.Width = 795
  353.     txtEnel.Width = 795
  354.     txtSKY.Width = 795
  355.     txtGiornali.Width = 795
  356.     txtAssicurazione.Width = 795
  357.     txtCondominio.Width = 795
  358.     txtMutuo.Width = 795
  359.     txtFinanziamento.Width = 795
  360.     txtPensione.Width = 795
  361.     txtMacchina.Width = 795
  362.     txtBenzina.Width = 795
  363.     txtADSL.Width = 795
  364.     txtRicariche.Width = 795
  365.     txtExtraUscite.Width = 795
  366.     txtAlimenti.Width = 795
  367.     txtVestiario.Width = 795
  368.     txtBeni.Width = 795
  369.     txtRegali.Width = 795
  370.     txtMedicine.Width = 795
  371.     txtCasa.Width = 795
  372.     txtMeccanico.Width = 795
  373.     txtViaggi.Width = 795
  374.     txtScuola.Width = 795
  375.     txtUniversita.Width = 795
  376.     txtRAI.Width = 795
  377.     txtExtraUsciteVariabili.Width = 795
  378.     txtStipendioMarito.Width = 795
  379.     txtStipendioMoglie.Width = 795
  380.     txtFondi.Width = 795
  381.     txtExtra.Width = 795
  382.  
  383.  
  384. End Sub
  385.  
  386. Private Sub mnuVisualizzaRiepilogoAltro_Click()
  387.     frmArchivio.Show 1
  388. End Sub
  389.  
  390. Private Sub mnuVisualizzaRiepilogoCorrente_Click()
  391.     Dim Testo As String
  392.     Dim a() As String
  393.     Dim i As Integer
  394.     'Chiudo tutti gli eventuali file aperti
  395.     Close
  396.     Open App.Path & "\" & Month(Now) & "-" & Year(Now) & ".dat" For Random As #1
  397.         Open App.Path & "\" & Month(Now) & "-" & Year(Now) & "-Temp.dat" For Random As #2
  398.    
  399.         Get #1, 1, Testo
  400.         a = Split(Testo, ":")
  401.         'RIMETTO A POSTO TUTTI I DATI PRECEDENTEMENTE SALVATI
  402.         For i = LBound(a) To UBound(a)
  403.             txtGas.Text = a(0) + Gas
  404.             txtTelefono.Text = a(1) + Telefono
  405.             txtAcqua.Text = a(2) + Acqua
  406.             txtSpazzatura.Text = a(3) + Spazzatura
  407.             txtEnel.Text = a(4) + Enel
  408.             txtSKY.Text = a(5) + SKY
  409.             txtGiornali.Text = a(6) + Giornali
  410.             txtAssicurazione.Text = a(7) + Assicurazione
  411.             txtCondominio.Text = a(8) + Condominio
  412.             txtMutuo.Text = a(9) + Mutuo
  413.             txtFinanziamento.Text = a(10) + Finanziamento
  414.             txtPensione.Text = a(11) + Pensione
  415.             txtMacchina.Text = a(12) + Macchina
  416.             txtBenzina.Text = a(13) + Benzina
  417.             txtADSL.Text = a(14) + ADSL
  418.             txtRicariche.Text = a(15) + Ricariche
  419.             txtExtraUscite.Text = a(16) + ExtraUscite
  420.             txtAlimenti.Text = a(17) + Alimenti
  421.             txtVestiario.Text = a(18) + Vestiario
  422.             txtBeni.Text = a(19) + Lusso
  423.             txtRegali.Text = a(20) + Regali
  424.             txtMedicine.Text = a(21) + Medicine
  425.             txtCasa.Text = a(22) + Casa
  426.             txtMeccanico.Text = a(23) + Meccanico
  427.             txtViaggi.Text = a(24) + Viaggi
  428.             txtScuola.Text = a(25) + Scuola
  429.             txtUniversita.Text = a(26) + Universita
  430.             txtRAI.Text = a(27) + RAI
  431.             txtExtraUsciteVariabili.Text = a(28) + ExtraUsciteVariabili
  432.             txtExtraUscite.Text = a(28) + ExtraUscite
  433.             txtStipendioMarito.Text = a(29) + StipendioMarito
  434.             txtStipendioMoglie.Text = a(30) + StipendioMoglie
  435.             txtFondi.Text = a(31) + Fondi
  436.             txtExtra.Text = a(32) + Extra
  437.             lblTot.Caption = ""
  438.             Next
  439.        
  440.        
  441.        
  442.         Testo = txtGas.Text & ":" & txtTelefono.Text & ":" & _
  443.             txtAcqua.Text & ":" & txtSpazzatura.Text & ":" & _
  444.             txtEnel.Text & ":" & txtSKY.Text & ":" & _
  445.             txtGiornali.Text & ":" & txtAssicurazione.Text & ":" & _
  446.             txtCondominio.Text & ":" & txtMutuo.Text & ":" & _
  447.             txtFinanziamento.Text & ":" & txtPensione.Text & ":" & _
  448.             txtMacchina.Text & ":" & txtBenzina.Text & ":" & _
  449.             txtADSL.Text & ":" & txtRicariche.Text & ":" & _
  450.             txtExtraUscite.Text & ":" & txtAlimenti.Text & ":" & _
  451.             txtVestiario.Text & ":" & txtBeni.Text & ":" & _
  452.             txtRegali.Text & ":" & txtMedicine.Text & ":" & _
  453.             txtCasa.Text & ":" & txtMeccanico.Text & ":" & _
  454.             txtViaggi.Text & ":" & txtScuola.Text & ":" & _
  455.             txtUniversita.Text & ":" & txtRAI.Text & ":" & _
  456.             txtExtraUsciteVariabili.Text & ":" & txtStipendioMarito.Text & ":" & _
  457.             txtStipendioMoglie.Text & ":" & txtFondi.Text & ":" & _
  458.             txtExtra.Text
  459.            
  460.         Put #1, 1, Testo
  461.     Close
  462.    
  463.     'AZZERO LE VARIABILI PERCHE' SE L'UTENTE RICLICCA SULLA VOCE RIEPILOGO
  464.     'IL PROGRAMMA CALCOLA NUOVAMENTE IL TUTTO
  465.     Gas = 0
  466.     Telefono = 0
  467.     Acqua = 0
  468.     Spazzatura = 0
  469.     Enel = 0
  470.     SKY = 0
  471.     Giornali = 0
  472.     Assicurazione = 0
  473.     Condominio = 0
  474.     Mutuo = 0
  475.     Finanziamento = 0
  476.     Pensione = 0
  477.     Macchina = 0
  478.     Benzina = 0
  479.     ADSL = 0
  480.     Ricariche = 0
  481.     ExtraUscite = 0
  482.     Alimenti = 0
  483.     Vestiario = 0
  484.     Lusso = 0
  485.     Regali = 0
  486.     Medicine = 0
  487.     Casa = 0
  488.     Meccanico = 0
  489.     Viaggi = 0
  490.     Scuola = 0
  491.     Universita = 0
  492.     RAI = 0
  493.     ExtraUsciteVariabili = 0
  494.     StipendioMarito = 0
  495.     StipendioMoglie = 0
  496.     Fondi = 0
  497.     Extra = 0
  498.    
  499.     'Attivo la voce del menu che permette di modificare i valori
  500.     'del file
  501.     mnuModificaValori.Enabled = True
  502.     mnuModificaAzzera.Enabled = True
  503.     lblRiepilogo.Visible = True
  504. End Sub
  505.  
  506. Private Sub Timer1_Timer()
  507.     frmMain.Caption = "Bilancio familiare - Data: " & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " - Orario: " & Time$
  508. End Sub
  509.  
  510. Private Sub txtAcqua_GotFocus()
  511.     If txtAcqua.Text <> "0" Then
  512.         Exit Sub
  513.     Else
  514.         txtAcqua.Text = ""
  515.     End If
  516. End Sub
  517.  
  518. Private Sub txtAcqua_LostFocus()
  519.     If txtAcqua.Text = "" Then
  520.         txtAcqua.Text = "0"
  521.     Else
  522.         Exit Sub
  523.     End If
  524. End Sub
  525.  
  526. Private Sub txtADSL_GotFocus()
  527.     If txtADSL.Text <> "0" Then
  528.         Exit Sub
  529.     Else
  530.         txtADSL.Text = ""
  531.     End If
  532. End Sub
  533.  
  534. Private Sub txtADSL_LostFocus()
  535.     If txtADSL.Text = "" Then
  536.         txtADSL.Text = "0"
  537.     Else
  538.         Exit Sub
  539.     End If
  540. End Sub
  541.  
  542. Private Sub txtAlimenti_GotFocus()
  543.     If txtAlimenti.Text <> "0" Then
  544.         Exit Sub
  545.     Else
  546.         txtAlimenti.Text = ""
  547.     End If
  548. End Sub
  549.  
  550. Private Sub txtAlimenti_LostFocus()
  551.     If txtAlimenti.Text = "" Then
  552.         txtAlimenti.Text = "0"
  553.     Else
  554.         Exit Sub
  555.     End If
  556. End Sub
  557.  
  558. Private Sub txtAssicurazione_GotFocus()
  559.     If txtAssicurazione.Text <> "0" Then
  560.         Exit Sub
  561.     Else
  562.         txtAssicurazione.Text = ""
  563.     End If
  564. End Sub
  565.  
  566. Private Sub txtAssicurazione_LostFocus()
  567.     If txtAssicurazione.Text = "" Then
  568.         txtAssicurazione.Text = "0"
  569.     Else
  570.         Exit Sub
  571.     End If
  572. End Sub
  573.  
  574. Private Sub txtBeni_GotFocus()
  575.     If txtBeni.Text <> "0" Then
  576.         Exit Sub
  577.     Else
  578.         txtBeni.Text = ""
  579.     End If
  580. End Sub
  581.  
  582. Private Sub txtBeni_LostFocus()
  583.     If txtBeni.Text = "" Then
  584.         txtBeni.Text = "0"
  585.     Else
  586.         Exit Sub
  587.     End If
  588. End Sub
  589.  
  590. Private Sub txtBenzina_GotFocus()
  591.     If txtBenzina.Text <> "0" Then
  592.         Exit Sub
  593.     Else
  594.         txtBenzina.Text = ""
  595.     End If
  596. End Sub
  597.  
  598. Private Sub txtBenzina_LostFocus()
  599.     If txtBenzina.Text = "" Then
  600.         txtBenzina.Text = "0"
  601.     Else
  602.         Exit Sub
  603.     End If
  604. End Sub
  605.  
  606. Private Sub txtCasa_GotFocus()
  607.     If txtCasa.Text <> "0" Then
  608.         Exit Sub
  609.     Else
  610.         txtCasa.Text = ""
  611.     End If
  612. End Sub
  613.  
  614. Private Sub txtCasa_LostFocus()
  615.     If txtCasa.Text = "" Then
  616.         txtCasa.Text = "0"
  617.     Else
  618.         Exit Sub
  619.     End If
  620. End Sub
  621.  
  622. Private Sub txtCondominio_GotFocus()
  623.     If txtCondominio.Text <> "0" Then
  624.         Exit Sub
  625.     Else
  626.         txtCondominio.Text = ""
  627.     End If
  628. End Sub
  629.  
  630. Private Sub txtCondominio_LostFocus()
  631.     If txtCondominio.Text = "" Then
  632.         txtCondominio.Text = "0"
  633.     Else
  634.         Exit Sub
  635.     End If
  636. End Sub
  637.  
  638. Private Sub txtEnel_GotFocus()
  639.     If txtEnel.Text <> "0" Then
  640.         Exit Sub
  641.     Else
  642.         txtEnel.Text = ""
  643.     End If
  644. End Sub
  645.  
  646. Private Sub txtEnel_LostFocus()
  647.     If txtEnel.Text = "" Then
  648.         txtEnel.Text = "0"
  649.     Else
  650.         Exit Sub
  651.     End If
  652. End Sub
  653.  
  654. Private Sub txtExtra_GotFocus()
  655.     If txtExtra.Text <> "0" Then
  656.         Exit Sub
  657.     Else
  658.         txtExtra.Text = ""
  659.     End If
  660. End Sub
  661.  
  662. Private Sub txtExtra_LostFocus()
  663.     If txtExtra.Text = "" Then
  664.         txtExtra.Text = "0"
  665.     Else
  666.         Exit Sub
  667.     End If
  668. End Sub
  669.  
  670. Private Sub txtExtraUscite_GotFocus()
  671.     If txtExtraUscite.Text <> "0" Then
  672.         Exit Sub
  673.     Else
  674.         txtExtraUscite.Text = ""
  675.     End If
  676. End Sub
  677.  
  678. Private Sub txtExtraUscite_LostFocus()
  679.     If txtExtraUscite.Text = "" Then
  680.         txtExtraUscite.Text = "0"
  681.     Else
  682.         Exit Sub
  683.     End If
  684. End Sub
  685.  
  686. Private Sub txtExtraUsciteVariabili_GotFocus()
  687.     If txtExtraUsciteVariabili.Text <> "0" Then
  688.         Exit Sub
  689.     Else
  690.         txtExtraUsciteVariabili.Text = ""
  691.     End If
  692. End Sub
  693.  
  694. Private Sub txtExtraUsciteVariabili_LostFocus()
  695.     If txtExtraUsciteVariabili.Text = "" Then
  696.         txtExtraUsciteVariabili.Text = "0"
  697.     Else
  698.         Exit Sub
  699.     End If
  700. End Sub
  701.  
  702. Private Sub txtFinanziamento_GotFocus()
  703.     If txtFinanziamento.Text <> "0" Then
  704.         Exit Sub
  705.     Else
  706.         txtFinanziamento.Text = ""
  707.     End If
  708. End Sub
  709.  
  710. Private Sub txtFinanziamento_LostFocus()
  711.     If txtFinanziamento.Text = "" Then
  712.         txtFinanziamento.Text = "0"
  713.     Else
  714.         Exit Sub
  715.     End If
  716. End Sub
  717.  
  718. Private Sub txtFondi_GotFocus()
  719.     If txtFondi.Text <> "0" Then
  720.         Exit Sub
  721.     Else
  722.         txtFondi.Text = ""
  723.     End If
  724. End Sub
  725.  
  726. Private Sub txtFondi_LostFocus()
  727.     If txtFondi.Text = "" Then
  728.         txtFondi.Text = "0"
  729.     Else
  730.         Exit Sub
  731.     End If
  732. End Sub
  733.  
  734. Private Sub txtGas_GotFocus()
  735.     If txtGas.Text <> "0" Then
  736.         Exit Sub
  737.     Else
  738.         txtGas.Text = ""
  739.     End If
  740. End Sub
  741.  
  742. Private Sub txtGas_LostFocus()
  743.     If txtGas.Text = "" Then
  744.         txtGas.Text = "0"
  745.     Else
  746.         Exit Sub
  747.     End If
  748. End Sub
  749.  
  750. Private Sub txtGiornali_GotFocus()
  751.     If txtGiornali.Text <> "0" Then
  752.         Exit Sub
  753.     Else
  754.         txtGiornali.Text = ""
  755.     End If
  756. End Sub
  757.  
  758. Private Sub txtGiornali_LostFocus()
  759.     If txtGiornali.Text = "" Then
  760.         txtGiornali.Text = "0"
  761.     Else
  762.         Exit Sub
  763.     End If
  764. End Sub
  765.  
  766. Private Sub txtMacchina_GotFocus()
  767.     If txtMacchina.Text <> "0" Then
  768.         Exit Sub
  769.     Else
  770.         txtMacchina.Text = ""
  771.     End If
  772. End Sub
  773.  
  774. Private Sub txtMacchina_LostFocus()
  775.     If txtMacchina.Text = "" Then
  776.         txtMacchina.Text = "0"
  777.     Else
  778.         Exit Sub
  779.     End If
  780. End Sub
  781.  
  782. Private Sub txtMeccanico_GotFocus()
  783.     If txtMeccanico.Text <> "0" Then
  784.         Exit Sub
  785.     Else
  786.         txtMeccanico.Text = ""
  787.     End If
  788. End Sub
  789.  
  790. Private Sub txtMeccanico_LostFocus()
  791.     If txtMeccanico.Text = "" Then
  792.         txtMeccanico.Text = "0"
  793.     Else
  794.         Exit Sub
  795.     End If
  796. End Sub
  797.  
  798. Private Sub txtMedicine_GotFocus()
  799.     If txtMedicine.Text <> "0" Then
  800.         Exit Sub
  801.     Else
  802.         txtMedicine.Text = ""
  803.     End If
  804. End Sub
  805.  
  806. Private Sub txtMedicine_LostFocus()
  807.     If txtMedicine.Text = "" Then
  808.         txtMedicine.Text = "0"
  809.     Else
  810.         Exit Sub
  811.     End If
  812. End Sub
  813.  
  814. Private Sub txtMutuo_GotFocus()
  815.     If txtMutuo.Text <> "0" Then
  816.         Exit Sub
  817.     Else
  818.         txtMutuo.Text = ""
  819.     End If
  820. End Sub
  821.  
  822. Private Sub txtMutuo_LostFocus()
  823.     If txtMutuo.Text = "" Then
  824.         txtMutuo.Text = "0"
  825.     Else
  826.         Exit Sub
  827.     End If
  828. End Sub
  829.  
  830. Private Sub txtPensione_GotFocus()
  831.     If txtPensione.Text <> "0" Then
  832.         Exit Sub
  833.     Else
  834.         txtPensione.Text = ""
  835.     End If
  836. End Sub
  837.  
  838. Private Sub txtPensione_LostFocus()
  839.     If txtPensione.Text = "" Then
  840.         txtPensione.Text = "0"
  841.     Else
  842.         Exit Sub
  843.     End If
  844. End Sub
  845.  
  846. Private Sub txtRAI_GotFocus()
  847.     If txtRAI.Text <> "0" Then
  848.         Exit Sub
  849.     Else
  850.         txtRAI.Text = ""
  851.     End If
  852. End Sub
  853.  
  854. Private Sub txtRAI_LostFocus()
  855.     If txtRAI.Text = "" Then
  856.         txtRAI.Text = "0"
  857.     Else
  858.         Exit Sub
  859.     End If
  860. End Sub
  861.  
  862. Private Sub txtRegali_GotFocus()
  863.     If txtRegali.Text <> "0" Then
  864.         Exit Sub
  865.     Else
  866.         txtRegali.Text = ""
  867.     End If
  868. End Sub
  869.  
  870. Private Sub txtRegali_LostFocus()
  871.     If txtRegali.Text = "" Then
  872.         txtRegali.Text = "0"
  873.     Else
  874.         Exit Sub
  875.     End If
  876. End Sub
  877.  
  878. Private Sub txtRicariche_GotFocus()
  879.     If txtRicariche.Text <> "0" Then
  880.         Exit Sub
  881.     Else
  882.         txtRicariche.Text = ""
  883.     End If
  884. End Sub
  885.  
  886. Private Sub txtRicariche_LostFocus()
  887.     If txtRicariche.Text = "" Then
  888.         txtRicariche.Text = "0"
  889.     Else
  890.         Exit Sub
  891.     End If
  892. End Sub
  893.  
  894. Private Sub txtScuola_GotFocus()
  895.     If txtScuola.Text <> "0" Then
  896.         Exit Sub
  897.     Else
  898.         txtScuola.Text = ""
  899.     End If
  900. End Sub
  901.  
  902. Private Sub txtScuola_LostFocus()
  903.     If txtScuola.Text = "" Then
  904.         txtScuola.Text = "0"
  905.     Else
  906.         Exit Sub
  907.     End If
  908. End Sub
  909.  
  910. Private Sub txtSKY_GotFocus()
  911.     If txtSKY.Text <> "0" Then
  912.         Exit Sub
  913.     Else
  914.         txtSKY.Text = ""
  915.     End If
  916. End Sub
  917.  
  918. Private Sub txtSKY_LostFocus()
  919.     If txtSKY.Text = "" Then
  920.         txtSKY.Text = "0"
  921.     Else
  922.         Exit Sub
  923.     End If
  924. End Sub
  925.  
  926. Private Sub txtSpazzatura_GotFocus()
  927.     If txtSpazzatura.Text <> "0" Then
  928.         Exit Sub
  929.     Else
  930.         txtSpazzatura.Text = ""
  931.     End If
  932. End Sub
  933.  
  934. Private Sub txtSpazzatura_LostFocus()
  935.     If txtSpazzatura.Text = "" Then
  936.         txtSpazzatura.Text = "0"
  937.     Else
  938.         Exit Sub
  939.     End If
  940. End Sub
  941.  
  942. Private Sub txtStipendioMarito_GotFocus()
  943.     If txtStipendioMarito.Text <> "0" Then
  944.         Exit Sub
  945.     Else
  946.         txtStipendioMarito.Text = ""
  947.     End If
  948. End Sub
  949.  
  950. Private Sub txtStipendioMarito_LostFocus()
  951.     If txtStipendioMarito.Text = "" Then
  952.         txtStipendioMarito.Text = "0"
  953.     Else
  954.         Exit Sub
  955.     End If
  956. End Sub
  957.  
  958. Private Sub txtStipendioMoglie_GotFocus()
  959.     If txtStipendioMoglie.Text <> "0" Then
  960.         Exit Sub
  961.     Else
  962.         txtStipendioMoglie.Text = ""
  963.     End If
  964. End Sub
  965.  
  966. Private Sub txtStipendioMoglie_LostFocus()
  967.     If txtStipendioMoglie.Text = "" Then
  968.         txtStipendioMoglie.Text = "0"
  969.     Else
  970.         Exit Sub
  971.     End If
  972. End Sub
  973.  
  974. Private Sub txtTelefono_GotFocus()
  975.     If txtTelefono.Text <> "0" Then
  976.         Exit Sub
  977.     Else
  978.         txtTelefono.Text = ""
  979.     End If
  980. End Sub
  981.  
  982. Private Sub txtTelefono_LostFocus()
  983.     If txtTelefono.Text = "" Then
  984.         txtTelefono.Text = "0"
  985.     Else
  986.         Exit Sub
  987.     End If
  988. End Sub
  989.  
  990. Private Sub txtUniversita_GotFocus()
  991.     If txtUniversita.Text <> "0" Then
  992.         Exit Sub
  993.     Else
  994.         txtUniversita.Text = ""
  995.     End If
  996. End Sub
  997.  
  998. Private Sub txtUniversita_LostFocus()
  999.     If txtUniversita.Text = "" Then
  1000.         txtUniversita.Text = "0"
  1001.     Else
  1002.         Exit Sub
  1003.     End If
  1004. End Sub
  1005.  
  1006. Private Sub txtVestiario_GotFocus()
  1007.     If txtVestiario.Text <> "0" Then
  1008.         Exit Sub
  1009.     Else
  1010.         txtVestiario.Text = ""
  1011.     End If
  1012. End Sub
  1013.  
  1014. Private Sub txtVestiario_LostFocus()
  1015.     If txtVestiario.Text = "" Then
  1016.         txtVestiario.Text = "0"
  1017.     Else
  1018.         Exit Sub
  1019.     End If
  1020. End Sub
  1021.  
  1022. Private Sub txtViaggi_GotFocus()
  1023.     If txtViaggi.Text <> "0" Then
  1024.         Exit Sub
  1025.     Else
  1026.         txtViaggi.Text = ""
  1027.     End If
  1028. End Sub
  1029.  
  1030. Private Sub txtViaggi_LostFocus()
  1031.     If txtViaggi.Text = "" Then
  1032.         txtViaggi.Text = "0"
  1033.     Else
  1034.         Exit Sub
  1035.     End If
  1036. End Sub