Option Compare Text
Dim salva As Boolean
Dim flag As Boolean
Dim T_IVA As Double, t_netto As Double
Dim attuale As Integer
#If Win32 Then
Private Declare Function SetBkMode Lib "gdi32" _
(ByVal hDC As Long, ByVal nBkMode As Long) As Long
Private iBKMode As Long
#Else
Private Declare Function SetBkMode Lib "GDI" (ByVal hDC As Integer _
, ByVal nBkMode As Integer) As Integer
Private iBKMode As Integer
#End If
Private Const TRANSPARENT = 1
Private Const OPAQUE = 2
Public Sub riordino()
' DB_PREV.Refresh
' DB_PREV.Recordset.MoveLast
DBGrid1.Columns(0).Visible = False
DBGrid1.Columns(1).Visible = False
DBGrid1.Columns(2).Visible = False
DBGrid1.Columns(3).Width = 720
DBGrid1.Columns(3).Alignment = 2
DBGrid1.Columns(4).Width = 1120
DBGrid1.Columns(4).Alignment = 2
DBGrid1.Columns(5).Width = 5900
DBGrid1.Columns(6).Width = 600
DBGrid1.Columns(6).Alignment = 2
DBGrid1.Columns(7).Width = 1100
DBGrid1.Columns(7).Alignment = 2
DBGrid1.Columns(8).Width = 1000
DBGrid1.Columns(9).Width = 1000
DBGrid1.Columns(10).Width = 1000
DBGrid1.Columns(11).Width = 1000
DBGrid1.Columns(12).Width = 1000
DBGrid1.Columns(13).Width = 1000
DBGrid1.Columns(14).Width = 1000
DBGrid1.Columns(15).Width = 700
DBGrid1.Columns(16).Width = 1000
' DBGrid1.SetFocus
End Sub
Function dividi(descr As String, l As Integer) As String
Dim cont As Integer
Dim lung As Integer
Dim spazio As String
' Lunghezza stringa restituita
lung = l
If Len(descr) <= lung Then
dividi = descr
Else
cont = lung
spazio = Mid(descr, lung, 1)
While Not spazio = " "
cont = cont - 1
spazio = Mid(descr, cont, 1)
Wend
dividi = Mid(descr, 1, cont)
End If
End Function
Private Sub CANCELLA()
Des.Text = ""
Um.Text = ""
Prunit.Text = ""
Prscont.Text = ""
Sconto.Text = ""
IVA.Text = ""
L9.Visible = False
L10.Visible = False
Costo.Visible = False
Ricarico.Visible = False
End Sub
Private Sub Stampa(pagina As Integer, stringa As String)
If pagina = 0 Or pagina = attuale Then
Printer.Print stringa
End If
End Sub
Private Sub Bt_addnota_Click()
If Not IsNull(DB_STOPRE.Recordset("NOTE")) Then
Note.Text = DB_STOPRE.Recordset("NOTE")
Else
Note.Text = ""
End If
Note.Visible = True
L_note.Visible = True
BT_insnota.Visible = True
Bt_annota.Visible = True
BT_parz.Visible = False
BT_forn.Visible = False
BT_var.Visible = False
Note.SetFocus
Bt_addnota.Visible = False
Call riordino
'Call Calcoli
End Sub
Private Sub BT_AnNota_Click()
Note.Visible = False
L_note.Visible = False
BT_insnota.Visible = False
Bt_annota.Visible = False
BT_parz.Visible = True
BT_var.Visible = True
Bt_addnota.Visible = True
BT_forn.Visible = True
DBGrid1.SetFocus
Call riordino
'Call Calcoli
End Sub
Private Sub BT_annvoce_Click()
BT_var.Visible = True
Bt_addnota.Visible = True
BT_parz.Visible = True
BT_newvoce.Visible = True
BT_elart.Visible = False
L9.Visible = False
L10.Visible = False
Costo.Visible = False
Ricarico.Visible = False
BT_modvoce.Visible = True
BT_cancvoce.Visible = True
BT_insvoce.Visible = False
BT_sta.Visible = True
scelta.Visible = False
BT_annvoce.Visible = False
BT_forn.Visible = True
flag = False
DB_PREV.Recordset.MoveLast
DB_PREV.Recordset.Delete
DB_PREV.Recordset.MoveLast
DBGrid1.SetFocus
Call riordino
'Call Calcoli
End Sub
Private Sub Bt_cancVoce_Click()
Dim Msg As String
Dim tipo_finmsg As Integer
If Not DB_PREV.Recordset.EOF Then
tipo_finmsg = 4
Msg = "Conferma la Cancellazione della voce dal documento ?"
If MsgBox(Msg, tipo_finmsg, "Cancella da Documento") = 6 Then
DB_PREV.Recordset.Delete
DB_PREV.Recordset.MoveNext
If DB_PREV.Recordset.EOF Then
DB_PREV.Refresh
If Not DB_PREV.Recordset.EOF Then DB_PREV.Recordset.MoveLast
End If
DBGrid1.SetFocus
' Me.Timer1.Enabled = True
Call Calcoli
Call riordino
End If
End If
'Call riordino
'Call Calcoli
End Sub
Private Sub BT_elart_Click()
scelta.ZOrder 0
scelta.Visible = True
End Sub
Private Sub BT_forn_Click()
F_CAMFOR.cliente = DB_STOPRE.Recordset("CLIENTE")
F_CAMFOR.NORD = NORD.Text
F_CAMFOR.DATA = DATA.Text
F_PREINS.Hide
F_CAMFOR.Show
End Sub
Private Sub BT_insnota_Click()
DB_STOPRE.Recordset.Edit
DB_STOPRE.Recordset("NOTE") = Note.Text
DB_STOPRE.Recordset.Update
Note.Visible = False
L_note.Visible = False
BT_insnota.Visible = False
Bt_annota.Visible = False
BT_parz.Visible = True
BT_var.Visible = True
BT_forn.Visible = True
Bt_addnota.Visible = True
DBGrid1.SetFocus
End Sub
Private Sub BT_insvoce_Click()
IVA.Text = DB_STOPRE.Recordset("IVA")
salva = True
DB_PREV.Recordset.Edit
DB_PREV.Recordset("NUMERO") = NORD.Text
If Qty.Text <> "" And Prscont.Text <> "" Then
DB_PREV.Recordset("IMPORTO") = Format((Qty.Text * Prscont.Text), F_MENU.FormatoEuro)
End If
If Qty.Text <> "" And UDC.Text <> "" Then
DB_PREV.Recordset("Tot_UDC") = Format((Qty.Text * UDC.Text), F_MENU.FormatoEuro)
End If
If Qty.Text <> "" And MANOD.Text <> "" Then
DB_PREV.Recordset("TMANOD") = Format((Qty.Text * MANOD.Text), F_MENU.FormatoEuro)
End If
DB_PREV.Recordset.Update
salva = False
BT_var.Visible = True
Bt_addnota.Visible = True
BT_parz.Visible = True
BT_sta.Visible = True
BT_newvoce.Visible = True
BT_modvoce.Visible = True
BT_cancvoce.Visible = True
BT_elart.Visible = False
scelta.Visible = False
L9.Visible = False
L10.Visible = False
Costo.Visible = False
Ricarico.Visible = False
BT_insvoce.Visible = False
BT_annvoce.Visible = False
BT_forn.Visible = True
DB_PREV.Recordset.MoveLast
DBGrid1.SetFocus
flag = False
Call Calcoli
Call riordino
' DBGrid1.SetFocus
End Sub
Private Sub BT_modvoce_Click()
If Not DB_PREV.Recordset.EOF Then
salva = True
DB_PREV.Recordset.Edit
If Qty.Text <> "" And Prscont.Text <> "" Then
DB_PREV.Recordset("IMPORTO") = Format((Qty.Text * Prscont.Text), F_MENU.FormatoEuro)
End If
If Qty.Text <> "" And UDC.Text <> "" Then
DB_PREV.Recordset("TOT_UDC") = Format((Qty.Text * UDC.Text), F_MENU.FormatoEuro)
End If
If Qty.Text <> "" And MANOD.Text <> "" Then
DB_PREV.Recordset("TMANOD") = Format((Qty.Text * MANOD.Text), F_MENU.FormatoEuro)
End If
DB_PREV.Recordset.Update
salva = False
DBGrid1.SetFocus
End If
Call Calcoli
Call riordino
End Sub
Private Sub BT_newvoce_Click()
' flag = True
DB_PREV.Recordset.AddNew
DB_PREV.Recordset("NUMERO") = NORD.Text
DB_PREV.Recordset.Update
'con il seguente comando aggiunge voce sempre e solo alla fine del database
DB_PREV.Recordset.MoveLast
Casa.Text = ""
Codice.Text = ""
Des.Text = ""
Um.Text = ""
UDC.Text = ""
TOT_UDC.Text = ""
MANOD.Text = ""
TMANOD.Text = ""
Prunit.Text = ""
Prscont.Text = ""
Sconto.Text = ""
IVA.Text = ""
BT_var.Visible = False
BT_elart.Visible = True
BT_sta.Visible = False
BT_insnota.Visible = False
flag = True
Bt_annota.Visible = False
L_note.Visible = False
Note.Visible = False
Bt_addnota.Visible = False
BT_parz.Visible = False
BT_newvoce.Visible = False
BT_insvoce.Visible = True
BT_annvoce.Visible = True
BT_modvoce.Visible = False
BT_forn.Visible = False
BT_cancvoce.Visible = False
Call riordino
'Call Calcoli
Casa.SetFocus
End Sub
Private Sub Calcoli()
Dim tipo_finmsg As String
Dim Msg As String
Dim IMPO, IVA, TUDC, TMANOD As Double
IMPO = 0
TUDC = 0
IVA = 0
TMANOD = 0
TOT1 = 0
UTIMP = 0
' DB_PREV.Refresh
While Not DB_PREV.Recordset.EOF
If Not IsNull(DB_PREV.Recordset("IMPORTO")) Then
IMPO = IMPO + DB_PREV.Recordset("IMPORTO")
End If
If Not IsNull(DB_PREV.Recordset("TOT_UDC")) Then
TUDC = TUDC + DB_PREV.Recordset("TOT_UDC")
End If
If Not IsNull(DB_PREV.Recordset("TMANOD")) Then
TMANOD = TMANOD + DB_PREV.Recordset("TMANOD")
End If
DB_PREV.Recordset.MoveNext
On Error GoTo errore
Wend
IVA = IMPO * DB_STOPRE.Recordset("IVA") / 100
TOT1 = TUDC + TMANOD
UTIMP = IMPO - TOT1
tipo_finmsg = 0
tot.Caption = Format(IMPO, F_MENU.FormatoEuro)
IVA1.Caption = Format(IVA, F_MENU.FormatoEuro)
impo1.Caption = Format(IMPO + IVA, F_MENU.FormatoEuro)
TUDC1.Caption = Format(TUDC, F_MENU.FormatoEuro)
TMANOD1.Caption = Format(TMANOD, F_MENU.FormatoEuro)
manodudc.Caption = Format(UTIMP + TMANOD, F_MENU.FormatoEuro)
utilimp.Caption = Format(IMPO - TOT1, F_MENU.FormatoEuro)
' Msg = "IL TOTALE DEI CALCOLI DI PREVENTIVO é " & Chr$(13)
' Msg = Msg & Chr$(13)
' Msg = Msg & "IMPONIBILE : " & Chr$(32) & Format(IMPO, F_MENU.FormatoEuro) & Chr$(13)
' Msg = Msg & "IVA : " & Format(IVA, F_MENU.FormatoEuro) & Chr$(13)
' Msg = Msg & "TOTALE : " & Format(IMPO + IVA, F_MENU.FormatoEuro) & Chr$(13) & Chr$(13)
' Msg = Msg & "TOTALE U.D.C. : " & Format(TUDC, F_MENU.FormatoEuro) & Chr$(13)
' Msg = Msg & "TOT. MANOD : " & Format(TMANOD, F_MENU.FormatoEuro) & Chr$(13) & Chr$(13)
' Msg = Msg & "MANOD + UDC : " & Format(TUDC + TMANOD, F_MENU.FormatoEuro) & Chr$(13)
' Msg = Msg & "UTILE IMP. : " & Format(IMPO - TOT1, F_MENU.FormatoEuro) & Chr$(13) & Chr$(13)
' If MsgBox(Msg, tipo_finmsg, "CALCOLI PREVENTIVO") = 1 Then
'End If
' DB_PREV.Refresh
' DB_PREV.Recordset.MoveLast
' End If
' salva = False
' Call riordino
' Me.Timer1.Enabled = True
Exit Sub
errore:
MsgBox "è inrtervenuto un erroe !", vbExclamation
On Error Resume Next
End Sub
Private Sub BT_sta_Click()
Dim I As Byte
DB_STAMPANTI.DatabaseName = CurDir & "\SEA.mdb"
DB_STAMPANTI.RecordSource = "db_stampanti"
DB_STAMPANTI.Refresh
I = DB_STAMPANTI.Recordset("IMPOSTATA")
attualmente.Text = Printers(I).DeviceName
For I = 0 To Printers.Count - 1
Stamp.AddItem Printers(I).DeviceName, I
Next I
st.ZOrder 0
Contratto.Value = 0
st.Visible = True
Call riordino
'Call Calcoli
End Sub
Private Sub BT_var_Click()
Variazione.ZOrder 0
Variazione.Visible = True
var.Text = ""
var.SetFocus
Call riordino
'Call Calcoli
End Sub
Private Sub Casa_LostFocus()
Dim esegui As Boolean
Casa.Text = UCase(Casa.Text)
esegui = True
If Codice.Text <> "" And flag Then
DB_ARTASS.RecordSource = "select * from db_artass where casa = " & Chr$(34) & Casa.Text & Chr$(34) & " and codice= " & Chr$(34) & Codice.Text & Chr$(34)
DB_ARTASS.Refresh
If Not DB_ARTASS.Recordset.EOF Then
Casa = DB_ARTASS.Recordset("CASA")
Codice = DB_ARTASS.Recordset("CODICE")
Des = DB_ARTASS.Recordset("DESCRIZIONE")
Um = DB_ARTASS.Recordset("UM")
UDC = DB_ARTASS.Recordset("UDC")
MANOD = DB_ARTASS.Recordset("Manod")
Costo = DB_ARTASS.Recordset("COSTO")
Ricarico = DB_ARTASS.Recordset("RICARICO")
Prunit = DB_ARTASS.Recordset("LISTINO")
Prscont = DB_ARTASS.Recordset("LISTINO")
IVA = DB_ARTASS.Recordset("IVA")
L9.Visible = True
L10.Visible = True
Costo.Visible = True
Ricarico.Visible = True
Qty.Text = 1
Sconto.Text = 0
esegui = False
Else
Call CANCELLA
End If
If esegui Then
DB_ARTICOLI.RecordSource = "select * from db_articoli where casa = " & Chr$(34) & Casa.Text & Chr$(34) & " and codice= " & Chr$(34) & Codice.Text & Chr$(34)
DB_ARTICOLI.Refresh
If Not DB_ARTICOLI.Recordset.EOF Then
Casa = DB_ARTICOLI.Recordset("CASA")
Codice = DB_ARTICOLI.Recordset("CODICE")
Des = DB_ARTICOLI.Recordset("DESCRIZIONE")
Um = DB_ARTICOLI.Recordset("UM")
Costo = DB_ARTICOLI.Recordset("COSTO")
UDC = DB_ARTICOLI.Recordset("costo")
Ricarico = DB_ARTICOLI.Recordset("RICARICO")
Prunit = DB_ARTICOLI.Recordset("LISTINO")
Prscont = DB_ARTICOLI.Recordset("LISTINO")
IVA = DB_ARTICOLI.Recordset("IVA")
L9.Visible = True
L10.Visible = True
Costo.Visible = True
Ricarico.Visible = True
Qty.Text = 1
Sconto.Text = 0
esegui = False
Else
Call CANCELLA
End If
End If
End If
End Sub
Private Sub codice_LostFocus()
Dim esegui As Boolean
Codice.Text = UCase(Codice.Text)
esegui = True
If Casa.Text <> "" And flag Then
DB_ARTASS.RecordSource = "select * from db_artass where casa = " & Chr$(34) & Casa.Text & Chr$(34) & " and codice= " & Chr$(34) & Codice.Text & Chr$(34)
DB_ARTASS.Refresh
If Not DB_ARTASS.Recordset.EOF Then
Casa = DB_ARTASS.Recordset("CASA")
Codice = DB_ARTASS.Recordset("CODICE")
Des = DB_ARTASS.Recordset("DESCRIZIONE")
Um = DB_ARTASS.Recordset("UM")
UDC = DB_ARTASS.Recordset("UDC")
MANOD = DB_ARTASS.Recordset("Manod")
Costo = DB_ARTASS.Recordset("COSTO")
Ricarico = DB_ARTASS.Recordset("RICARICO")
Prunit = DB_ARTASS.Recordset("LISTINO")
Prscont = DB_ARTASS.Recordset("LISTINO")
IVA = DB_ARTASS.Recordset("IVA")
L9.Visible = True
L10.Visible = True
Costo.Visible = True
Ricarico.Visible = True
Qty.Text = 1
Sconto.Text = 0
esegui = False
Else
Call CANCELLA
End If
If esegui Then
DB_ARTICOLI.RecordSource = "select * from db_articoli where casa = " & Chr$(34) & Casa.Text & Chr$(34) & " and codice= " & Chr$(34) & Codice.Text & Chr$(34)
DB_ARTICOLI.Refresh
If Not DB_ARTICOLI.Recordset.EOF Then
Casa = DB_ARTICOLI.Recordset("CASA")
Codice = DB_ARTICOLI.Recordset("CODICE")
Des = DB_ARTICOLI.Recordset("DESCRIZIONE")
Um = DB_ARTICOLI.Recordset("UM")
UDC = DB_ARTICOLI.Recordset("COSTO")
Costo = DB_ARTICOLI.Recordset("COSTO")
Ricarico = DB_ARTICOLI.Recordset("RICARICO")
Prunit = DB_ARTICOLI.Recordset("LISTINO")
Prscont = DB_ARTICOLI.Recordset("LISTINO")
IVA = DB_ARTICOLI.Recordset("IVA")
L9.Visible = True
L10.Visible = True
Costo.Visible = True
Ricarico.Visible = True
Qty.Text = 1
Sconto.Text = 0
esegui = False
Else
Call CANCELLA
End If
End If
End If
End Sub
Private Sub Command1_Click()
With F_ARTRMO
.L_DocP.Visible = True
.mnuart.Enabled = False
.mnumenu.Enabled = False
.BT_REGMOD.Visible = False
.BT_CANCELLA.Visible = False
.BT_pins.Visible = True
.BT_pann.Visible = True
End With
scelta.Visible = False
F_ARTRMO.Caption = "Inserimento Articoli Singoli in Preventivo"
F_PREINS.Hide
F_ARTRMO.Show
End Sub
Private Sub Command2_Click()
With F_ASSRMO
.L_DocP.Visible = True
.mnuart.Enabled = False
.mnumenu.Enabled = False
.BT_REGMOD.Visible = False
.BT_CANCELLA.Visible = False
.BT_pins.Visible = True
.BT_pann.Visible = True
End With
scelta.Visible = False
F_ARTRMO.Caption = "Inserimento Articoli Assemblati in Preventivo"
F_PREINS.Hide
F_ASSRMO.Show
End Sub
Private Sub Command3_Click()
scelta.Visible = False
End Sub
Private Sub Command6_Click()
Stamp.Clear
st.Visible = False
End Sub
Private Sub dis_modello()
' verticali
' Printer.Line (42, 8.5)-(95, 8.5)
Printer.Line (42, 16.5)-(95, 16.5) ', RGB(184, 227, 254), BF
Printer.Line (5, 14.5)-(42, 14.5) ', RGB(184, 227, 254), BF
Printer.Line (5, 20.5)-(95, 20.5) ', RGB(184, 227, 254), BF
Printer.Line (5, 22.5)-(95, 22.5) ', RGB(184, 227, 254), BF
Printer.Line (5, 52.5)-(84.5, 52.5) ', RGB(184, 227, 254), BF
Printer.Line (12, 54.5)-(62, 54.5) ', RGB(184, 227, 254), BF
Printer.Line (8, 56)-(62, 56) ', RGB(184, 227, 254), BF
Printer.Line (8, 57.5)-(62, 57.5) ', RGB(184, 227, 254), BF
Printer.Line (84.5, 54.5)-(95, 54.5) ', RGB(184, 227, 254), BF
Printer.Line (84.5, 56.5)-(95, 56.5) ', RGB(184, 227, 254), BF
Printer.Line (5, 58)-(95, 58) ', RGB(184, 227, 254), BF
Printer.Line (5, 60)-(18, 60) ', RGB(184, 227, 254), BF
' orizzontali
Printer.Line (42, 14.5)-(42, 20.5) ', RGB(184, 227, 254), BF
Printer.Line (5, 14.5)-(5, 60) ', RGB(184, 227, 254), BF
Printer.Line (18, 58)-(18, 60) ', RGB(184, 227, 254), BF
' Printer.Line (5, 12)-(5, 62)', RGB(184, 227, 254), BF
Printer.Line (20, 20.5)-(20, 22.5) ', RGB(184, 227, 254), BF
Printer.Line (58, 20.5)-(58, 52.5) ', RGB(184, 227, 254), BF
' Printer.Line (59.5, 12)-(59.5, 62)
Printer.Line (62, 20.5)-(62, 52.5) ', RGB(184, 227, 254), BF
Printer.Line (70, 20.5)-(70, 52.5) ', RGB(184, 227, 254), BF
Printer.Line (65, 52.5)-(65, 58) ', RGB(184, 227, 254), BF
Printer.Line (84.5, 20.5)-(84.5, 58) ', RGB(184, 227, 254), BF
Printer.Line (95, 16.5)-(95, 58) ', RGB(184, 227, 254), BF
End Sub
Private Sub Command7_Click()
Dim fine, OK As Boolean
Dim impor As Double
Dim d1 As String, d2 As String, D3 As String, D4 As String, D5 As String, D6 As String, D7 As String, D8 As String, D11 As String, D21 As String, D31 As String
Dim i1 As String, I2 As String
Dim descrizione As String
Dim indi As String
Dim nota As String
Dim CDA As String
Dim codart As String
Dim Cas As String
Dim Prez As Double
Dim v_netto As Double
Dim Qta As Long
Dim Linea As Integer
Dim tipo_finmsg As Integer
Dim Msg, UMI As String
Dim Lpt As String
Dim V_IVA As Double
Dim v_totale As Double
Dim aliq As Single
Dim lung_sta As Integer
Dim colonna As Integer
Dim pag As Integer
Dim logo As New StdPicture
Dim Appl As Object
Dim Doc As Object
If CInt(copiuz.Text) = 0 Then GoTo Nfatt
If Stamp.ListIndex >= 0 Then
Set Printer = Printers(Stamp.ListIndex)
DB_STAMPANTI.Recordset.Edit
DB_STAMPANTI.Recordset("IMPOSTATA") = Stamp.ListIndex
DB_STAMPANTI.Recordset.Update
End If
If Contratto.Value = vbChecked Then
Set Appl = CreateObject("Word.Application")
'background dell'applicazione
Appl.application.Visible = False
On Error GoTo errato
Set Doc = Appl.Documents.Open(App.Path & "\capitolato")
Doc.FormFields("Data").Result = DATA.Text 'Adesso
Appl.application.PrintOut
'chiusura dell'applicazione e Doc
Doc.CLOSE (False)
Appl.quit
Set Doc = Nothing
Set Appl = Nothing
End If
' Con 12 caratteri per pollice
' [0..95] colonne
' [0..74] righe
'On Error Resume Next
Printer.ScaleMode = 4
'Printer.ScaleHeight = 330
'Printer.ScaleWidth = 217
Printer.PaperSize = 9
Printer.Copies = copiuz.Text
'Printer.ScaleMode = 6
Printer.FontTransparent = True
'Correctly sets the background mix mode to transparent
iBKMode = SetBkMode(Printer.hDC, TRANSPARENT)
tipo_finmsg = 0
Msg = "Impossibile eseguire la stampa." & Chr$(13)
Msg = Msg & "Verificare che la stampante impostata sia quella corretta"
If MsgBox(Msg, tipo_finmsg, "Stampa Preventivo") = 1 Then
End If
Else
If tutte.Value = 1 Then
pag = 0
Else
pag = nump.Text
End If
attuale = 1
fine = False
DB_CLIENTI.DatabaseName = CurDir & "\SEA.mdb"
DB_CLIENTI.RecordSource = "select * from db_clienti where codice = " & DB_STOPRE.Recordset("CODCLI")
DB_CLIENTI.Refresh
aliq = DB_STOPRE.Recordset("IVA")
DB_PREV.RecordSource = "select * from db_prev where NUMERO =" & NORD.Text & " order by ID "
DB_PREV.Refresh
While Not fine
F_PREINS.Caption = "STAMPA DEL PREVENTIVO IN CORSO SI PREGA DI ATTENDERE"
' parte dedicata alla stampa del modello su foglio A4
If modulo.Value = vbUnchecked Then
Set logo = LoadPicture(CurDir & "\logoP.bmp")
Printer.PaintPicture logo, 1, 1, 37, 9
Printer.FontName = "Arial"
Printer.ForeColor = vbBlue 'RGB(184, 227, 254)
Printer.FontSize = 7.5
Printer.CurrentX = 55
Printer.CurrentY = 2
Lpt = "IMPIANTI ELETTRICI CIVILI INDUSTRIALI"
Call Stampa(pag, Lpt)
Printer.CurrentX = 55
Printer.CurrentY = 3
Lpt = "AUDIOVISIVI - SERVICE PER CONCERTI"
Call Stampa(pag, Lpt)
Printer.CurrentX = 55
Printer.CurrentY = 4
Lpt = "COMMERCIO MATERIALE ELETTRICO - TV ANTENNE - TELEFONIA"
Call Stampa(pag, Lpt)
Printer.CurrentX = 55
Printer.CurrentY = 5
Lpt = "DOMOTICA - AUTOMATISMI - RIVELAZIONE INCENDI "
Call Stampa(pag, Lpt)
Printer.CurrentX = 55
Printer.CurrentY = 6
Lpt = "PARTITA IVA/CODICE FISCALE 0170798 034 6"
Call Stampa(pag, Lpt)
Printer.CurrentX = 55
Printer.CurrentY = 7
Lpt = "C.I.A.A. PR172901 ALBO ARTIGIANI 52134"
Call Stampa(pag, Lpt)
Printer.ForeColor = False
dis_modello
Printer.FontName = "Times New Roman"
Printer.FontBold = True
Printer.FontSize = 12
Printer.CurrentX = 7
Printer.CurrentY = 15
Lpt = "PREVENTIVO N."
Call Stampa(pag, Lpt)
Printer.CurrentX = 18
Printer.CurrentY = 17
Lpt = "DEL :"
Call Stampa(pag, Lpt)
Printer.FontBold = False
Printer.FontSize = 7
Printer.CurrentX = 10
Printer.CurrentY = 21.1
Lpt = "CODICE"
Call Stampa(pag, Lpt)
Printer.CurrentX = 35
Printer.CurrentY = 21.1
Lpt = "DESCRIZIONE"
Call Stampa(pag, Lpt)
Printer.CurrentX = 59
Printer.CurrentY = 21.1
Lpt = "U.M."
Call Stampa(pag, Lpt)
Printer.CurrentX = 64
Printer.CurrentY = 21.1
Lpt = "QUANT."
Call Stampa(pag, Lpt)
Printer.CurrentX = 72
Printer.CurrentY = 21.1
Lpt = "PREZZO UNITARIO"
Call Stampa(pag, Lpt)
Printer.CurrentX = 87
Printer.CurrentY = 21.1
Lpt = "IMPORTO"
Call Stampa(pag, Lpt)
Printer.FontSize = 9
Printer.CurrentX = 76
Printer.CurrentY = 53
Lpt = "imponibile"
Call Stampa(pag, Lpt)
Printer.CurrentX = 7
Printer.CurrentY = 53.5
Lpt = "NOTE :"
Call Stampa(pag, Lpt)
Printer.CurrentX = 71
Printer.CurrentY = 55
Lpt = "IVA...........%"
Call Stampa(pag, Lpt)
Printer.CurrentX = 67
Printer.CurrentY = 57
Lpt = "TOTALE DOCUMENTO"
Call Stampa(pag, Lpt)
End If
' Fine Parte dedicata alla stampa del modello su foglio A4
If Not IsNull(DB_CLIENTI.Recordset("NOME")) Then
indi = DB_CLIENTI.Recordset("NOME")
Else
indi = ""
End If
i1 = dividi(indi, 39)
indi = Right(indi, Len(indi) - Len(i1))
I2 = dividi(indi, 39)
indi = Right(indi, Len(indi) - Len(I2))
i1 = Trim(i1)
I2 = Trim(I2)
Printer.FontBold = True
Printer.FontSize = 12
Printer.CurrentX = 52
Printer.CurrentY = 10
Call Stampa(pag, i1)
If I2 <> "" Then
Printer.CurrentX = 54
Printer.CurrentY = 11
Call Stampa(pag, I2)
End If
Printer.FontBold = False
Printer.FontSize = 11
Printer.CurrentX = 52
Printer.CurrentY = 12
Lpt = DB_CLIENTI.Recordset("VIA")
Call Stampa(pag, Lpt)
Printer.CurrentX = 52
Printer.CurrentY = 13
Lpt = DB_CLIENTI.Recordset("CAP") & ", " & DB_CLIENTI.Recordset("CITTA") & " " & DB_CLIENTI.Recordset("PROVINCIA")
Call Stampa(pag, Lpt)
' Printer.FontBold = True
Printer.CurrentX = 52
Printer.CurrentY = 17
Lpt = "P.IVA/Cod.Fisc.: " & DB_CLIENTI.Recordset("PIVA") & " "
Call Stampa(pag, Lpt)
Printer.CurrentX = 52
Printer.CurrentY = 18
Lpt = "Telefono: " & DB_CLIENTI.Recordset("TEL") & " - Codice Cliente : " & DB_STOPRE.Recordset("codcli")
Call Stampa(pag, Lpt)
Printer.FontBold = True
Printer.FontSize = 13
Printer.CurrentX = 28
Printer.CurrentY = 15
Lpt = NORD.Text
Call Stampa(pag, Lpt)
Printer.CurrentX = 28
Printer.CurrentY = 17
Lpt = DATA.Text
Call Stampa(pag, Lpt)
Linea = 23
' Printer.FontName = "Times New Roman"
Printer.FontName = "Courier New"
Printer.FontSize = 10
Printer.FontBold = False
If Not IsNull(DB_STOPRE.Recordset("NOTE")) Then
nota = DB_STOPRE.Recordset("NOTE")
Else
nota = ""
End If
d1 = dividi(nota, 50)
nota = Right(nota, Len(nota) - Len(d1))
d2 = dividi(nota, 55)
nota = Right(nota, Len(nota) - Len(d2))
D3 = dividi(nota, 55)
d1 = Trim(d1)
d2 = Trim(d2)
D3 = Trim(D3)
Printer.CurrentX = 15
Printer.CurrentY = 53
Call Stampa(pag, d1)
If d2 <> "" Then
Printer.CurrentX = 10
Printer.CurrentY = 55
Call Stampa(pag, d2)
If D3 <> "" Then
Printer.CurrentX = 10
Printer.CurrentY = 56.5
Call Stampa(pag, D3)
End If
End If
While Not DB_PREV.Recordset.EOF And Not Linea > 51
codart = ""
Casa = ""
CDA = ""
D11 = ""
D21 = ""
D31 = ""
If Not IsNull(DB_PREV.Recordset("CASA")) Then
Cas = DB_PREV.Recordset("CASA")
End If
If Not IsNull(DB_PREV.Recordset("CODICE")) Then
codart = DB_PREV.Recordset("CODICE")
CDA = Cas & " " & codart
End If
D11 = Mid(CDA, 1, 13)
Printer.CurrentX = 7
Printer.CurrentY = Linea
Call Stampa(pag, D11)
If Len(CDA) > 13 Then
D21 = Mid(CDA, 14, 13)
If Len(D21) > 13 Then
D31 = Mid(CDA, 26, 13)
End If
End If
If Not IsNull(DB_PREV.Recordset("DESCRIZIONE")) Then
descrizione = DB_PREV.Recordset("DESCRIZIONE")
Else
descrizione = ""
End If
d1 = dividi(descrizione, 36)
descrizione = Right(descrizione, Len(descrizione) - Len(d1))
d2 = dividi(descrizione, 36)
descrizione = Right(descrizione, Len(descrizione) - Len(d2))
D3 = dividi(descrizione, 36)
descrizione = Right(descrizione, Len(descrizione) - Len(D3))
D4 = dividi(descrizione, 36)
descrizione = Right(descrizione, Len(descrizione) - Len(D4))
D5 = dividi(descrizione, 36)
descrizione = Right(descrizione, Len(descrizione) - Len(D5))
D6 = dividi(descrizione, 36)
descrizione = Right(descrizione, Len(descrizione) - Len(D6))
D7 = dividi(descrizione, 36)
descrizione = Right(descrizione, Len(descrizione) - Len(D7))
D8 = dividi(descrizione, 36)
d1 = Trim(d1)
d2 = Trim(d2)
D3 = Trim(D3)
D4 = Trim(D4)
D5 = Trim(D5)
D6 = Trim(D6)
D7 = Trim(D7)
D8 = Trim(D8)
Printer.CurrentX = 20
Printer.CurrentY = Linea
Call Stampa(pag, d1)
If Not IsNull(DB_PREV.Recordset("UM")) Then
UMIS = DB_PREV.Recordset("UM")
Printer.CurrentX = 59
Printer.CurrentY = Linea
Call Stampa(pag, Um)
End If
If Not IsNull(DB_PREV.Recordset("QUANTITA")) Then
Qta = DB_PREV.Recordset("QUANTITA")
If Qta - Int(Qta) = 0 Then
lung_sta = Len(Format(Qta, F_MENU.FormatoEuro))
Printer.CurrentX = 68 - lung_sta
Printer.CurrentY = Linea
Call Stampa(pag, (Format(Qty, F_MENU.FormatoEuro)))
Else
lung_sta = Len(Format(Qty, F_MENU.FormatoEuro))
Printer.CurrentX = 68 - lung_sta
Printer.CurrentY = Linea
Call Stampa(pag, Format(Qty, F_MENU.FormatoEuro))
End If
End If
If Not IsNull(DB_PREV.Recordset("PREZZO")) Then
Prez = DB_PREV.Recordset("PREZZO")
lung_sta = Len(Format(Prez, F_MENU.FormatoEuro))
colonna = 81 - lung_sta
Printer.CurrentX = colonna
Printer.CurrentY = Linea
Call Stampa(pag, Format(Prez, F_MENU.FormatoEuro))
End If
If Not IsNull(DB_PREV.Recordset("IMPORTO")) Then
impor = DB_PREV.Recordset("IMPORTO")
lung_sta = Len(Format(impor, F_MENU.FormatoEuro))
colonna = 94 - lung_sta
Printer.CurrentX = colonna
Printer.CurrentY = Linea
Call Stampa(pag, Format(impor, F_MENU.FormatoEuro))
End If
If d2 <> "" Or D21 <> "" Then
Linea = Linea + 1
If d2 <> "" Then
Printer.CurrentX = 20
Printer.CurrentY = Linea
Call Stampa(pag, d2)
End If
If D21 <> "" Then
Printer.CurrentX = 7
Printer.CurrentY = Linea
Call Stampa(pag, D21)
End If
If D3 <> "" Or D31 <> "" Then
Linea = Linea + 1
If D3 <> "" Then
Printer.CurrentX = 20
Printer.CurrentY = Linea
Call Stampa(pag, D3)
End If
If D31 <> "" Then
Printer.CurrentX = 7
Printer.CurrentY = Linea
Call Stampa(pag, D31)
End If
If D4 <> "" Then
Linea = Linea + 1
Printer.CurrentX = 20
Printer.CurrentY = Linea
Call Stampa(pag, D4)
If D5 <> "" Then
Linea = Linea + 1
Printer.CurrentX = 20
Printer.CurrentY = Linea
Call Stampa(pag, D5)
If D6 <> "" Then
Linea = Linea + 1
Printer.CurrentX = 20
Printer.CurrentY = Linea
Call Stampa(pag, D6)
If D7 <> "" Then
Linea = Linea + 1
Printer.CurrentX = 20
Printer.CurrentY = Linea
Call Stampa(pag, D7)
If D8 <> "" Then
Linea = Linea + 1
Printer.CurrentX = 20
Printer.CurrentY = Linea
Call Stampa(pag, D8)
End If
End If
End If
End If
End If
End If
End If
Linea = Linea + 1
DB_PREV.Recordset.MoveNext
Wend
If DB_PREV.Recordset.EOF Then
fine = True
Printer.CurrentX = 75
Printer.CurrentY = 55
Lpt = CStr(aliq)
Call Stampa(pag, Lpt)
' Da cambiare quando la valuta sarà in EURO
Netto (aliq)
' S_IVA (aliq)
v_netto = t_netto
lung_sta = Len(Format(v_netto, F_MENU.FormatoEuro))
colonna = 94 - lung_sta
Printer.CurrentX = colonna
Printer.CurrentY = 53
Call Stampa(pag, Format(v_netto, F_MENU.FormatoEuro))
V_IVA = T_IVA
lung_sta = Len(Format(V_IVA, F_MENU.FormatoEuro))
colonna = 94 - lung_sta
Printer.CurrentX = colonna
Printer.CurrentY = 55
Call Stampa(pag, Format(V_IVA, F_MENU.FormatoEuro))
v_totale = v_netto + V_IVA
lung_sta = Len(Format(v_totale, F_MENU.FormatoEuro))
colonna = 94 - lung_sta
Printer.CurrentX = colonna
Printer.CurrentY = 57
Call Stampa(pag, Format(v_totale, F_MENU.FormatoEuro))
Printer.CurrentX = 7
Printer.CurrentY = 59
Lpt = "Pagina " & attuale
Call Stampa(pag, Lpt)
Printer.EndDoc
Else
Printer.CurrentX = 7
Printer.CurrentY = 59
Lpt = "Pagina " & attuale
Call Stampa(pag, Lpt)
Printer.CurrentX = 89
Printer.CurrentY = 57
Call Stampa(pag, "Segue")
If pag = 0 Then
Printer.NewPage
attuale = attuale + 1
Else
attuale = attuale + 1
End If
End If
Wend
F_PREINS.Caption = "Creazione Preventivi"
End If
On Error GoTo 0
st.Visible = False
Call riordino
'Call Calcoli
copiuz.Text = 0
Stamp.Clear
Exit Sub
Nfatt: MsgBox "Devi dirmi Quante Copie Ne Vuoi!!!!", vbExclamation
Exit Sub
errato: MsgBox "il documento citato non e presente oppure presenta un nome errato il nome corretto è 'Capitolato' ", vbExclamation
Resume Next
Resume
End Sub
Private Sub Command8_Click()
Variazione.Visible = False
End Sub
Private Sub Command9_Click()
Dim Ric As Single
Variazione.Visible = False
If var.Text <> "" Then
DB_PREV.Refresh
salva = True
While Not DB_PREV.Recordset.EOF
If Not IsNull(DB_PREV.Recordset("PREZZO")) Then
Ric = DB_PREV.Recordset("PREZZO") * var.Text / 100
DB_PREV.Recordset.Edit
DB_PREV.Recordset("PREZZO") = Format((DB_PREV.Recordset("PREZZOI") - Ric), F_MENU.FormatoEuro)
' On Error Resume Next
DB_PREV.Recordset("IMPORTO") = Format((DB_PREV.Recordset("PREZZO") * DB_PREV.Recordset("QUANTITA")), F_MENU.FormatoEuro)
DB_PREV.Recordset("SCONTO") = Format(var.Text, F_MENU.FormatoEuro)
DB_PREV.Recordset.Update
End If
DB_PREV.Recordset.MoveNext
Wend
salva = False
Me.Timer1.Enabled = True
End If
End Sub
Private Sub DB_prev_Validate(Action As Integer, Save As Integer)
If salva = False Then Save = False
End Sub
Private Sub Netto(V_IVA As Double)
DB_PREV.RecordSource = "select * from db_prev where NUMERO =" & NORD.Text & " order by ID "
DB_PREV.Refresh
t_netto = "0"
T_IVA = "0"
While Not DB_PREV.Recordset.EOF
If Not IsNull(DB_PREV.Recordset("PREZZO")) Then
t_netto = t_netto + DB_PREV.Recordset("IMPORTO")
End If
DB_PREV.Recordset.MoveNext
Wend
T_IVA = t_netto * V_IVA / 100
End Sub
'Private Sub S_IVA(V_IVA As Currency)
' DB_PREV.RecordSource = "select * from db_prev where NUMERO =" & NORD.Text & " order by ID "
' DB_PREV.Refresh
' T_IVA = "0"
' T_IVA = t_netto * V_IVA / 100
'End Sub
Private Sub DBGrid1_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = "g" Or Chr(KeyAscii) = "G" Then DBGrid1.Height = 8500
If Chr(KeyAscii) = "p" Or Chr(KeyAscii) = "P" Then DBGrid1.Height = 2616
End Sub
Private Sub Form_Activate()
flag = True
' Call Calcoli
If BT_elart.Visible = False Then
' Call Calcoli
DB_PREV.DatabaseName = CurDir$ & "\SEA.mdb"
DB_PREV.RecordSource = "select * from db_Prev where numero = " & NORD.Text & " order by ID"
DB_PREV.Refresh
Call Calcoli
flag = False
End If
DB_ARTICOLI.DatabaseName = CurDir$ & "\SEA.mdb"
DB_ARTASS.DatabaseName = CurDir$ & "\SEA.mdb"
DB_STOPRE.DatabaseName = CurDir$ & "\SEA.mdb"
DB_STOPRE.RecordSource = "select * from db_stopre where numero = " & NORD.Text
DB_STOPRE.Refresh
DB_EURO.DatabaseName = CurDir & "\SEA.mdb"
DB_EURO.RecordSource = "db_EURO"
DB_EURO.Refresh
' If L_DocP.Visible Then
' Call riordino
' Else
' Call Calcoli
Call riordino
' End If
' salva = False
' DBGrid1.Columns(0).Visible = False
'DBGrid1.Columns(1).Visible = False
'DBGrid1.Columns(2).Width = 620
' DBGrid1.Columns(2).Alignment = 2
' DBGrid1.Columns(3).Width = 620
' DBGrid1.Columns(3).Alignment = 2
' DBGrid1.Columns(4).Width = 920
' DBGrid1.Columns(4).Alignment = 2
' DBGrid1.Columns(5).Width = 4700
' DBGrid1.Columns(6).Width = 500
' DBGrid1.Columns(6).Alignment = 2
' DBGrid1.Columns(7).Width = 723
' DBGrid1.Columns(7).Alignment = 2
' DBGrid1.Columns(8).Width = 680
' DBGrid1.Columns(9).Width = 680
' DBGrid1.Columns(10).Width = 680
' DBGrid1.Columns(11).Width = 680
' DBGrid1.Columns(12).Width = 680
' DBGrid1.Columns(13).Width = 680
' DBGrid1.Columns(14).Width = 550
' DBGrid1.Columns(15).Width = 550
' DBGrid1.Columns(16).Width = 680
End Sub
Private Sub Form_Deactivate()
Dim IMPO, IVA, parz As Double
IMPO = 0
DB_PREV.Refresh
While Not DB_PREV.Recordset.EOF
If Not IsNull(DB_PREV.Recordset("PREZZO")) And Not IsNull(DB_PREV.Recordset("QUANTITA")) And Not IsNull(DB_PREV.Recordset("IVA")) Then
IMPO = IMPO + DB_PREV.Recordset("IMPORTO")
End If
DB_PREV.Recordset.MoveNext
Wend
DB_STOPRE.Recordset.Edit
DB_STOPRE.Recordset("IMPONIBILE") = Format(IMPO, F_MENU.FormatoEuro)
DB_STOPRE.Recordset.Update
End Sub
Private Sub Form_Load()
Dim X As Integer
Dim Y As Integer
X = (Screen.Width - 11400) / 2
Y = (Screen.Height - 8004) / 2
F_PREINS.Move X, Y
End Sub
Private Sub Form_Resize()
DBGrid1.Width = Me.Width - 250
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call Form_Deactivate
End
End Sub
Private Sub IVA_LostFocus()
Dim tipo_finmsg As String
Dim Msg As String
If IVA.Text <> "" And Not IsNumeric(IVA.Text) Then
tipo_finmsg = 0
Msg = "La Quantità non è in formato numerico"
If MsgBox(Msg, tipo_finmsg, "Creazione Preventivo") = 1 Then
End If
IVA.SetFocus
End If
End Sub
Private Sub MANOD_LostFocus()
Dim tipo_finmsg As String
Dim Msg As String
If MANOD.Text <> "" And Not IsNumeric(MANOD.Text) Then
tipo_finmsg = 0
Msg = "Il prezzo non è in formato numerico"
If MsgBox(Msg, tipo_finmsg, "Creazione Preventivo") = 1 Then
End If
MANOD.SetFocus
End If
End Sub
Private Sub mnuesci_Click()
Bt_addnota.Visible = True
BT_parz.Visible = True
BT_newvoce.Visible = True
BT_elart.Visible = False
L9.Visible = False
L10.Visible = False
Costo.Visible = False
Ricarico.Visible = False
BT_modvoce.Visible = True
BT_cancvoce.Visible = True
BT_insvoce.Visible = False
BT_annvoce.Visible = False
BT_forn.Visible = True
F_PREINS.Hide
F_MENU.Show
End Sub
Private Sub mnuins_Click()
F_MENU.DATA.Text = Date
F_MENU.DB_STOPRE.DatabaseName = CurDir & "\SEA.mdb"
F_MENU.DB_STOPRE.RecordSource = "select * from db_stopre order by numero"
F_MENU.DB_STOPRE.Refresh
If Not F_MENU.DB_STOPRE.Recordset.EOF Then
F_MENU.DB_STOPRE.Recordset.MoveLast
F_MENU.NORD.Text = DB_STOPRE.Recordset("numero") + 1
Else
F_MENU.NORD.Text = 1
End If
F_MENU.Prev.Visible = True
F_MENU.NORD.Visible = True
F_MENU.dat.Visible = True
F_MENU.DATA.Visible = True
F_MENU.num.Visible = True
F_MENU.V_IVA.Visible = True
F_MENU.IVA.Visible = True
F_MENU.BtIns.Visible = True
F_MENU.Btann.Visible = True
Bt_addnota.Visible = True
BT_parz.Visible = True
BT_newvoce.Visible = True
BT_elart.Visible = False
L9.Visible = False
L10.Visible = False
Costo.Visible = False
Ricarico.Visible = False
BT_modvoce.Visible = True
BT_cancvoce.Visible = True
BT_insvoce.Visible = False
BT_annvoce.Visible = False
BT_forn.Visible = True
F_PREINS.Hide
F_MENU.Show
End Sub
Private Sub mnuric_Click()
Bt_addnota.Visible = True
BT_parz.Visible = True
BT_newvoce.Visible = True
BT_elart.Visible = False
L9.Visible = False
L10.Visible = False
Costo.Visible = False
Ricarico.Visible = False
BT_modvoce.Visible = True
BT_cancvoce.Visible = True
BT_insvoce.Visible = False
BT_annvoce.Visible = False
BT_forn.Visible = True
F_PREINS.Hide
F_STOPRE.Show
End Sub
Private Sub nump_Change()
If nump.Text <> "" Then tutte.Value = 0
End Sub
Private Sub nump_GotFocus()
If nump.Text <> "" Then tutte.Value = 0
End Sub
Private Sub Prscont_LostFocus()
Dim tipo_finmsg As String
Dim Msg As String
If Prscont.Text <> "" And Not IsNumeric(Prscont.Text) Then
tipo_finmsg = 0
Msg = "La Quantità non è in formato numerico"
If MsgBox(Msg, tipo_finmsg, "Creazione Preventivo") = 1 Then
End If
Prscont.SetFocus
End If
End Sub
Private Sub Prunit_LostFocus()
Dim tipo_finmsg As String
Dim Msg As String
If Prunit.Text <> "" And Not IsNumeric(Prunit.Text) Then
tipo_finmsg = 0
Msg = "Il prezzo non è in formato numerico"
If MsgBox(Msg, tipo_finmsg, "Creazione Preventivo") = 1 Then
End If
Prunit.SetFocus
End If
If Prunit.Text <> "" And IsNumeric(Prunit.Text) Then
Sconto.Text = 0
Prscont.Text = Prunit.Text
IVA.Text = DB_STOPRE.Recordset("IVA")
End If
End Sub
Private Sub Qty_LostFocus()
Dim tipo_finmsg As String
Dim Msg As String
If Qty.Text <> "" And Not IsNumeric(Qty.Text) Then
tipo_finmsg = 0
Msg = "La Quantità non è in formato numerico"
If MsgBox(Msg, tipo_finmsg, "Creazione Preventivo") = 1 Then
End If
Qty.SetFocus
End If
End Sub
Private Sub r_Click()
F_PREINS.Hide
F_STOPRE.Show
F_STOPRE.Codice_Cliente.Visible = True
'Call F_STOPRE.ordCli_Click
'DB_STOPRE.RecordSource = "select * from db_stopre where codcli=" & F_STOPRE.cliente.Text
' DB_STOPRE.Refresh
' If DB_STOPRE.Recordset.EOF Then
' Call messaggio
' End If
'Call riord
End Sub
Private Sub Sconto_LostFocus()
Dim tipo_finmsg As String
Dim Msg As String
Dim sc As Currency
If Sconto.Text <> "" And Not IsNumeric(Sconto.Text) Then
tipo_finmsg = 0
Msg = "La Quantità non è in formato numerico"
If MsgBox(Msg, tipo_finmsg, "Creazione Preventivo") = 1 Then
End If
Sconto.SetFocus
Else
If Sconto.Text <> "" And Prunit <> "" Then
sc = Prunit.Text * Sconto.Text / 100
Prscont = Prunit - sc
End If
End If
End Sub
Private Sub Timer1_Timer()
Form_Activate
'Call Calcoli
Me.Timer1.Enabled = False
End Sub
Private Sub tutte_Click()
If tutte.Value = 1 Then
nump.Text = ""
End If
End Sub
Private Sub UM_LostFocus()
Um.Text = UCase(Um.Text)
End Sub
Private Sub Var_LostFocus()
Dim tipo_finmsg As String
Dim Msg As String
If var.Text <> "" And Not IsNumeric(var.Text) Then
tipo_finmsg = 0
Msg = "La Quantità non è in formato numerico"
If MsgBox(Msg, tipo_finmsg, "Creazione Preventivo") = 1 Then
End If
var.SetFocus
End If
End Sub