home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "msmask32.ocx"
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 4005
- ClientLeft = -75
- ClientTop = 1380
- ClientWidth = 9525
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 4005
- ScaleWidth = 9525
- Begin VB.CommandButton AnnullaButton
- Caption = "Annulla"
- Height = 495
- Left = 0
- TabIndex = 23
- Top = 3480
- Width = 1815
- End
- Begin VB.CommandButton OkButton
- Caption = "Ok"
- Height = 495
- Left = 0
- TabIndex = 22
- Top = 2520
- Width = 1815
- End
- Begin VB.PictureBox Picture1
- Height = 855
- Left = 0
- ScaleHeight = 795
- ScaleWidth = 1755
- TabIndex = 20
- Top = 1560
- Width = 1815
- End
- Begin VB.TextBox NoteTxtBox
- Height = 1095
- Left = 1920
- TabIndex = 15
- Top = 2880
- Width = 7575
- End
- Begin VB.TextBox IndirizzoText
- Height = 1335
- Left = 1920
- TabIndex = 3
- Top = 1080
- Width = 3255
- End
- Begin VB.Frame Frame1
- Caption = "Recapiti"
- Height = 2055
- Left = 5280
- TabIndex = 2
- Top = 0
- Width = 4215
- Begin VB.CheckBox EMailChk
- Caption = "E-Mail"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 1680
- Width = 1215
- End
- Begin VB.CheckBox FaxChk
- Caption = "Fax"
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 1320
- Width = 1215
- End
- Begin VB.CheckBox CellChk
- Caption = "Cellulare"
- Height = 255
- Left = 120
- TabIndex = 6
- Top = 960
- Width = 1215
- End
- Begin VB.CheckBox UffChk
- Caption = "Ufficio"
- Height = 255
- Left = 120
- TabIndex = 5
- Top = 600
- Width = 1215
- End
- Begin VB.CheckBox CasaChk
- Caption = "Casa"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 240
- Width = 1215
- End
- Begin MSMask.MaskEdBox MailTxtBox
- Height = 255
- Left = 1800
- TabIndex = 13
- Top = 1680
- Width = 2295
- _ExtentX = 4048
- _ExtentY = 450
- _Version = 327681
- PromptChar = "_"
- End
- Begin MSMask.MaskEdBox FaxTxtBox
- Height = 255
- Left = 1800
- TabIndex = 12
- Top = 1320
- Width = 2295
- _ExtentX = 4048
- _ExtentY = 450
- _Version = 327681
- PromptChar = "_"
- End
- Begin MSMask.MaskEdBox CellulareTxtBox
- Height = 255
- Left = 1800
- TabIndex = 11
- Top = 960
- Width = 2295
- _ExtentX = 4048
- _ExtentY = 450
- _Version = 327681
- PromptChar = "_"
- End
- Begin MSMask.MaskEdBox UfficioTxtBox
- Height = 255
- Left = 1800
- TabIndex = 10
- Top = 600
- Width = 2295
- _ExtentX = 4048
- _ExtentY = 450
- _Version = 327681
- PromptChar = "_"
- End
- Begin MSMask.MaskEdBox CasaTxtBox
- Height = 255
- Left = 1800
- TabIndex = 9
- Top = 240
- Width = 2295
- _ExtentX = 4048
- _ExtentY = 450
- _Version = 327681
- PromptChar = "_"
- End
- End
- Begin VB.TextBox CognomeTxt
- Height = 375
- Left = 1920
- MaxLength = 30
- TabIndex = 1
- Top = 600
- Width = 3255
- End
- Begin VB.TextBox NomeTxt
- Height = 375
- Left = 1920
- MaxLength = 30
- TabIndex = 0
- Top = 120
- Width = 3255
- End
- Begin MSMask.MaskEdBox NascitaTxtBox
- Height = 255
- Left = 7080
- TabIndex = 14
- Top = 2160
- Width = 2415
- _ExtentX = 4260
- _ExtentY = 450
- _Version = 327681
- Format = "dd/mm/yyyy"
- PromptChar = "_"
- End
- Begin VB.Label Label5
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Data di nascita"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 5280
- TabIndex = 21
- Top = 2160
- Width = 1695
- End
- Begin VB.Label Label4
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Indirizzo"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 0
- TabIndex = 19
- Top = 1080
- Width = 1815
- End
- Begin VB.Label Label3
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Cognome"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 0
- TabIndex = 18
- Top = 600
- Width = 1815
- End
- Begin VB.Label Label2
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Nome"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 0
- TabIndex = 17
- Top = 120
- Width = 1815
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Note ed informazioni addizionali"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 1920
- TabIndex = 16
- Top = 2520
- Width = 7575
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim Tabella As Recordset
- Sub OkButton_Click()
- If Not (IsDate(NascitaTxtBox.Text)) Then
- Beep
- MsgBox "La data inserita non
- corretta. E' necessario inserire una data valida!", 16, "Contacts Manager: Errore!"
- NascitaTxtBox.SetFocus
- Exit Sub
- End If
- If DateDiff("d", NascitaTxtBox.Text, Date) < 3650 Then
- Beep
- MsgBox "La data inserita non
- valida in quanto troppo vicina a quella corrente!", 16, "Contacts Manager: Errore!"
- NascitaTxtBox.SetFocus
- Exit Sub
- End If
- If Not (IsAdding) Then
- BeginTrans
- Form2.FoundRecords.Edit
- End If
- If IsAdding Then
- Set Tabella = Archivio.OpenRecordset("Contatti", dbOpenTable)
- If Err = 3011 Then
- Set DefTabella = Archivio.CreateTableDef("Contatti")
- Set Campo = DefTabella.CreateField("Codice", dbInteger)
- DefTabella.Fields.Append Campo
- Campo = DefTabella.CreateField("Nome", dbText, 30)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("Cognome", dbText, 30)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("Indirizzo", dbText, 100)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("TelCasa", dbText, 9)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("TelUff", dbText, 9)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("TelCell", dbText, 9)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("TelFax", dbText, 9)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("E-mail", dbText, 30)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("Nascita", dbDate)
- DefTabella.Fields.Append Campo
- Set Campo = DefTabella.CreateField("Note", dbText, 100)
- DefTabella.Fields.Append Campo
- Set Indice = DefTabella.CreateIndex("Codice")
- Indice.Primary = True
- Indice.Unique = True
- Campo = DefTabella.CreateField("Codice")
- Indice.Fields.Append Campo
- DefTabella.Indexes.Append Indice
- Archivio.TableDefs.Append DefTabella
- NuovaTabella = True
- End If
- BeginTrans
- If NuovaTabella = True Then
- Tabella.AddNew
- Tabella("Codice") = 1
- Else
- Tabella.MoveLast
- Codice = Tabella("Codice") + 1
- Tabella.AddNew
- Tabella("Codice") = Codice
- End If
- End If
- If Not (IsAdding) Then Tabella = Form2.FoundRecords
- Tabella("Nome") = Form1.NomeTxt.Text
- Tabella("Cognome") = Form1.CognomeTxt.Text
- Tabella("Indirizzo") = Form1.IndirizzoText.Text
- Tabella("TelCasa") = Form1.CasaTxtBox.Text
- Tabella("TelUff") = Form1.UfficioTxtBox.Text
- Tabella("TelCell") = Form1.CellulareTxtBox.Text
- Tabella("TelFax") = Form1.FaxTxtBox.Text
- Tabella("E-mail") = Form1.MailTxtBox
- Tabella("Nascita") = Form1.NascitaTxtBox.Text
- Tabella("Note") = Form1.NoteTxtBox.Text
- Tabella.Update
- CommitTrans
- Tabella.Close
- FoundRecords.Close
- Tabella = Null
- Form1.Hide
- Form3.Show
- End Sub
-
-