home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / corsovb / cm.frm (.txt) next >
Encoding:
Visual Basic Form  |  1997-10-15  |  12.8 KB  |  369 lines

  1. VERSION 5.00
  2. Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "msmask32.ocx"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   4005
  6.    ClientLeft      =   -75
  7.    ClientTop       =   1380
  8.    ClientWidth     =   9525
  9.    LinkTopic       =   "Form1"
  10.    PaletteMode     =   1  'UseZOrder
  11.    ScaleHeight     =   4005
  12.    ScaleWidth      =   9525
  13.    Begin VB.CommandButton AnnullaButton 
  14.       Caption         =   "Annulla"
  15.       Height          =   495
  16.       Left            =   0
  17.       TabIndex        =   23
  18.       Top             =   3480
  19.       Width           =   1815
  20.    End
  21.    Begin VB.CommandButton OkButton 
  22.       Caption         =   "Ok"
  23.       Height          =   495
  24.       Left            =   0
  25.       TabIndex        =   22
  26.       Top             =   2520
  27.       Width           =   1815
  28.    End
  29.    Begin VB.PictureBox Picture1 
  30.       Height          =   855
  31.       Left            =   0
  32.       ScaleHeight     =   795
  33.       ScaleWidth      =   1755
  34.       TabIndex        =   20
  35.       Top             =   1560
  36.       Width           =   1815
  37.    End
  38.    Begin VB.TextBox NoteTxtBox 
  39.       Height          =   1095
  40.       Left            =   1920
  41.       TabIndex        =   15
  42.       Top             =   2880
  43.       Width           =   7575
  44.    End
  45.    Begin VB.TextBox IndirizzoText 
  46.       Height          =   1335
  47.       Left            =   1920
  48.       TabIndex        =   3
  49.       Top             =   1080
  50.       Width           =   3255
  51.    End
  52.    Begin VB.Frame Frame1 
  53.       Caption         =   "Recapiti"
  54.       Height          =   2055
  55.       Left            =   5280
  56.       TabIndex        =   2
  57.       Top             =   0
  58.       Width           =   4215
  59.       Begin VB.CheckBox EMailChk 
  60.          Caption         =   "E-Mail"
  61.          Height          =   255
  62.          Left            =   120
  63.          TabIndex        =   8
  64.          Top             =   1680
  65.          Width           =   1215
  66.       End
  67.       Begin VB.CheckBox FaxChk 
  68.          Caption         =   "Fax"
  69.          Height          =   255
  70.          Left            =   120
  71.          TabIndex        =   7
  72.          Top             =   1320
  73.          Width           =   1215
  74.       End
  75.       Begin VB.CheckBox CellChk 
  76.          Caption         =   "Cellulare"
  77.          Height          =   255
  78.          Left            =   120
  79.          TabIndex        =   6
  80.          Top             =   960
  81.          Width           =   1215
  82.       End
  83.       Begin VB.CheckBox UffChk 
  84.          Caption         =   "Ufficio"
  85.          Height          =   255
  86.          Left            =   120
  87.          TabIndex        =   5
  88.          Top             =   600
  89.          Width           =   1215
  90.       End
  91.       Begin VB.CheckBox CasaChk 
  92.          Caption         =   "Casa"
  93.          Height          =   255
  94.          Left            =   120
  95.          TabIndex        =   4
  96.          Top             =   240
  97.          Width           =   1215
  98.       End
  99.       Begin MSMask.MaskEdBox MailTxtBox 
  100.          Height          =   255
  101.          Left            =   1800
  102.          TabIndex        =   13
  103.          Top             =   1680
  104.          Width           =   2295
  105.          _ExtentX        =   4048
  106.          _ExtentY        =   450
  107.          _Version        =   327681
  108.          PromptChar      =   "_"
  109.       End
  110.       Begin MSMask.MaskEdBox FaxTxtBox 
  111.          Height          =   255
  112.          Left            =   1800
  113.          TabIndex        =   12
  114.          Top             =   1320
  115.          Width           =   2295
  116.          _ExtentX        =   4048
  117.          _ExtentY        =   450
  118.          _Version        =   327681
  119.          PromptChar      =   "_"
  120.       End
  121.       Begin MSMask.MaskEdBox CellulareTxtBox 
  122.          Height          =   255
  123.          Left            =   1800
  124.          TabIndex        =   11
  125.          Top             =   960
  126.          Width           =   2295
  127.          _ExtentX        =   4048
  128.          _ExtentY        =   450
  129.          _Version        =   327681
  130.          PromptChar      =   "_"
  131.       End
  132.       Begin MSMask.MaskEdBox UfficioTxtBox 
  133.          Height          =   255
  134.          Left            =   1800
  135.          TabIndex        =   10
  136.          Top             =   600
  137.          Width           =   2295
  138.          _ExtentX        =   4048
  139.          _ExtentY        =   450
  140.          _Version        =   327681
  141.          PromptChar      =   "_"
  142.       End
  143.       Begin MSMask.MaskEdBox CasaTxtBox 
  144.          Height          =   255
  145.          Left            =   1800
  146.          TabIndex        =   9
  147.          Top             =   240
  148.          Width           =   2295
  149.          _ExtentX        =   4048
  150.          _ExtentY        =   450
  151.          _Version        =   327681
  152.          PromptChar      =   "_"
  153.       End
  154.    End
  155.    Begin VB.TextBox CognomeTxt 
  156.       Height          =   375
  157.       Left            =   1920
  158.       MaxLength       =   30
  159.       TabIndex        =   1
  160.       Top             =   600
  161.       Width           =   3255
  162.    End
  163.    Begin VB.TextBox NomeTxt 
  164.       Height          =   375
  165.       Left            =   1920
  166.       MaxLength       =   30
  167.       TabIndex        =   0
  168.       Top             =   120
  169.       Width           =   3255
  170.    End
  171.    Begin MSMask.MaskEdBox NascitaTxtBox 
  172.       Height          =   255
  173.       Left            =   7080
  174.       TabIndex        =   14
  175.       Top             =   2160
  176.       Width           =   2415
  177.       _ExtentX        =   4260
  178.       _ExtentY        =   450
  179.       _Version        =   327681
  180.       Format          =   "dd/mm/yyyy"
  181.       PromptChar      =   "_"
  182.    End
  183.    Begin VB.Label Label5 
  184.       Alignment       =   2  'Center
  185.       BorderStyle     =   1  'Fixed Single
  186.       Caption         =   "Data di nascita"
  187.       BeginProperty Font 
  188.          Name            =   "MS Sans Serif"
  189.          Size            =   9.75
  190.          Charset         =   0
  191.          Weight          =   700
  192.          Underline       =   0   'False
  193.          Italic          =   0   'False
  194.          Strikethrough   =   0   'False
  195.       EndProperty
  196.       Height          =   255
  197.       Left            =   5280
  198.       TabIndex        =   21
  199.       Top             =   2160
  200.       Width           =   1695
  201.    End
  202.    Begin VB.Label Label4 
  203.       Alignment       =   2  'Center
  204.       BorderStyle     =   1  'Fixed Single
  205.       Caption         =   "Indirizzo"
  206.       BeginProperty Font 
  207.          Name            =   "MS Sans Serif"
  208.          Size            =   12
  209.          Charset         =   0
  210.          Weight          =   700
  211.          Underline       =   0   'False
  212.          Italic          =   0   'False
  213.          Strikethrough   =   0   'False
  214.       EndProperty
  215.       Height          =   375
  216.       Left            =   0
  217.       TabIndex        =   19
  218.       Top             =   1080
  219.       Width           =   1815
  220.    End
  221.    Begin VB.Label Label3 
  222.       Alignment       =   2  'Center
  223.       BorderStyle     =   1  'Fixed Single
  224.       Caption         =   "Cognome"
  225.       BeginProperty Font 
  226.          Name            =   "MS Sans Serif"
  227.          Size            =   12
  228.          Charset         =   0
  229.          Weight          =   700
  230.          Underline       =   0   'False
  231.          Italic          =   0   'False
  232.          Strikethrough   =   0   'False
  233.       EndProperty
  234.       Height          =   375
  235.       Left            =   0
  236.       TabIndex        =   18
  237.       Top             =   600
  238.       Width           =   1815
  239.    End
  240.    Begin VB.Label Label2 
  241.       Alignment       =   2  'Center
  242.       BorderStyle     =   1  'Fixed Single
  243.       Caption         =   "Nome"
  244.       BeginProperty Font 
  245.          Name            =   "MS Sans Serif"
  246.          Size            =   12
  247.          Charset         =   0
  248.          Weight          =   700
  249.          Underline       =   0   'False
  250.          Italic          =   0   'False
  251.          Strikethrough   =   0   'False
  252.       EndProperty
  253.       Height          =   375
  254.       Left            =   0
  255.       TabIndex        =   17
  256.       Top             =   120
  257.       Width           =   1815
  258.    End
  259.    Begin VB.Label Label1 
  260.       Alignment       =   2  'Center
  261.       BorderStyle     =   1  'Fixed Single
  262.       Caption         =   "Note ed informazioni addizionali"
  263.       BeginProperty Font 
  264.          Name            =   "MS Sans Serif"
  265.          Size            =   12
  266.          Charset         =   0
  267.          Weight          =   700
  268.          Underline       =   0   'False
  269.          Italic          =   0   'False
  270.          Strikethrough   =   0   'False
  271.       EndProperty
  272.       Height          =   375
  273.       Left            =   1920
  274.       TabIndex        =   16
  275.       Top             =   2520
  276.       Width           =   7575
  277.    End
  278. Attribute VB_Name = "Form1"
  279. Attribute VB_GlobalNameSpace = False
  280. Attribute VB_Creatable = False
  281. Attribute VB_PredeclaredId = True
  282. Attribute VB_Exposed = False
  283. Dim Tabella As Recordset
  284. Sub OkButton_Click()
  285.         If Not (IsDate(NascitaTxtBox.Text)) Then
  286.                 Beep
  287.                 MsgBox "La data inserita non 
  288.  corretta. E' necessario inserire una data valida!", 16, "Contacts Manager: Errore!"
  289.                 NascitaTxtBox.SetFocus
  290.                 Exit Sub
  291.         End If
  292.         If DateDiff("d", NascitaTxtBox.Text, Date) < 3650 Then
  293.                 Beep
  294.                 MsgBox "La data inserita non 
  295.  valida in quanto troppo vicina a quella corrente!", 16, "Contacts Manager: Errore!"
  296.                 NascitaTxtBox.SetFocus
  297.                 Exit Sub
  298.         End If
  299.         If Not (IsAdding) Then
  300.                 BeginTrans
  301.                 Form2.FoundRecords.Edit
  302.         End If
  303.         If IsAdding Then
  304.                 Set Tabella = Archivio.OpenRecordset("Contatti", dbOpenTable)
  305.                 If Err = 3011 Then
  306.                         Set DefTabella = Archivio.CreateTableDef("Contatti")
  307.                         Set Campo = DefTabella.CreateField("Codice", dbInteger)
  308.                         DefTabella.Fields.Append Campo
  309.                         Campo = DefTabella.CreateField("Nome", dbText, 30)
  310.                         DefTabella.Fields.Append Campo
  311.                         Set Campo = DefTabella.CreateField("Cognome", dbText, 30)
  312.                         DefTabella.Fields.Append Campo
  313.                         Set Campo = DefTabella.CreateField("Indirizzo", dbText, 100)
  314.                         DefTabella.Fields.Append Campo
  315.                         Set Campo = DefTabella.CreateField("TelCasa", dbText, 9)
  316.                         DefTabella.Fields.Append Campo
  317.                         Set Campo = DefTabella.CreateField("TelUff", dbText, 9)
  318.                         DefTabella.Fields.Append Campo
  319.                         Set Campo = DefTabella.CreateField("TelCell", dbText, 9)
  320.                         DefTabella.Fields.Append Campo
  321.                         Set Campo = DefTabella.CreateField("TelFax", dbText, 9)
  322.                         DefTabella.Fields.Append Campo
  323.                         Set Campo = DefTabella.CreateField("E-mail", dbText, 30)
  324.                         DefTabella.Fields.Append Campo
  325.                         Set Campo = DefTabella.CreateField("Nascita", dbDate)
  326.                         DefTabella.Fields.Append Campo
  327.                         Set Campo = DefTabella.CreateField("Note", dbText, 100)
  328.                         DefTabella.Fields.Append Campo
  329.                         Set Indice = DefTabella.CreateIndex("Codice")
  330.                         Indice.Primary = True
  331.                         Indice.Unique = True
  332.                         Campo = DefTabella.CreateField("Codice")
  333.                         Indice.Fields.Append Campo
  334.                         DefTabella.Indexes.Append Indice
  335.                         Archivio.TableDefs.Append DefTabella
  336.                         NuovaTabella = True
  337.                 End If
  338.                 BeginTrans
  339.                 If NuovaTabella = True Then
  340.                         Tabella.AddNew
  341.                         Tabella("Codice") = 1
  342.                 Else
  343.                         Tabella.MoveLast
  344.                         Codice = Tabella("Codice") + 1
  345.                         Tabella.AddNew
  346.                         Tabella("Codice") = Codice
  347.                 End If
  348.         End If
  349.         If Not (IsAdding) Then Tabella = Form2.FoundRecords
  350.         Tabella("Nome") = Form1.NomeTxt.Text
  351.         Tabella("Cognome") = Form1.CognomeTxt.Text
  352.         Tabella("Indirizzo") = Form1.IndirizzoText.Text
  353.         Tabella("TelCasa") = Form1.CasaTxtBox.Text
  354.         Tabella("TelUff") = Form1.UfficioTxtBox.Text
  355.         Tabella("TelCell") = Form1.CellulareTxtBox.Text
  356.         Tabella("TelFax") = Form1.FaxTxtBox.Text
  357.         Tabella("E-mail") = Form1.MailTxtBox
  358.         Tabella("Nascita") = Form1.NascitaTxtBox.Text
  359.         Tabella("Note") = Form1.NoteTxtBox.Text
  360.         Tabella.Update
  361.         CommitTrans
  362.         Tabella.Close
  363.         FoundRecords.Close
  364.         Tabella = Null
  365.         Form1.Hide
  366.         Form3.Show
  367. End Sub
  368.         
  369.