home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0210 - 0219 / ibm0210-0219 / ibm0213.tar / ibm0213 / PWA_AWAR.ZIP / SAMPVB.Z / PERSON.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-07-05  |  15.8 KB  |  448 lines

  1. VERSION 2.00
  2. Begin Form person 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Choose a Custom Calendar"
  6.    ClientHeight    =   3900
  7.    ClientLeft      =   840
  8.    ClientTop       =   645
  9.    ClientWidth     =   7575
  10.    Height          =   4305
  11.    Left            =   780
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3900
  14.    ScaleWidth      =   7575
  15.    Top             =   300
  16.    Width           =   7695
  17.    Begin AwareBinary fpBinary1 
  18.       BackColor       =   &H00C0C0C0&
  19.       BorderStyle     =   0  'No Border
  20.       FontBold        =   -1  'True
  21.       FontItalic      =   0   'False
  22.       FontName        =   "System"
  23.       FontSize        =   9.75
  24.       FontStrikethru  =   0   'False
  25.       FontUnderline   =   0   'False
  26.       Height          =   3915
  27.       Left            =   0
  28.       TabIndex        =   4
  29.       ThreeDFrameWidth=   5
  30.       ThreeDInsideHighlightColor=   &H00FFFFFF&
  31.       ThreeDInsideShadowColor=   &H00808080&
  32.       ThreeDInsideStyle=   2  'Raised
  33.       ThreeDInsideWidth=   2
  34.       ThreeDOutsideHighlightColor=   &H00FFFFFF&
  35.       ThreeDOutsideShadowColor=   &H00808080&
  36.       ThreeDOutsideStyle=   2  'Raised
  37.       Top             =   0
  38.       Width           =   7290
  39.       Begin AwareText fpText3 
  40.          BackColor       =   &H00C0C0C0&
  41.          BorderStyle     =   0  'No Border
  42.          ControlType     =   2  'Static
  43.          FontBold        =   -1  'True
  44.          FontItalic      =   0   'False
  45.          FontName        =   "MS Sans Serif"
  46.          FontSize        =   8.25
  47.          FontStrikethru  =   0   'False
  48.          FontUnderline   =   0   'False
  49.          ForeColor       =   &H000000FF&
  50.          Height          =   315
  51.          Index           =   2
  52.          Left            =   150
  53.          TabIndex        =   12
  54.          TabStop         =   0   'False
  55.          Text            =   "Enter a password to protect your files:"
  56.          ThreeDOutsideHighlightColor=   &H00FFFFFF&
  57.          ThreeDOutsideStyle=   1  'Lowered
  58.          ThreeDTextHighlightColor=   &H00FFFFFF&
  59.          ThreeDTextShadowColor=   &H00808080&
  60.          Top             =   2850
  61.          Visible         =   0   'False
  62.          Width           =   3390
  63.       End
  64.       Begin AwareText password 
  65.          AlignTextH      =   1  'Center
  66.          AlignTextV      =   1  'Center
  67.          AutoCase        =   2  'Lower
  68.          FontBold        =   -1  'True
  69.          FontItalic      =   0   'False
  70.          FontName        =   "MS Sans Serif"
  71.          FontSize        =   9.75
  72.          FontStrikethru  =   0   'False
  73.          FontUnderline   =   0   'False
  74.          Height          =   390
  75.          Left            =   150
  76.          PasswordChar    =   "*"
  77.          TabIndex        =   2
  78.          ThreeDOutsideHighlightColor=   &H00FFFFFF&
  79.          ThreeDTextHighlightColor=   &H00000014&
  80.          ThreeDTextShadowColor=   &H00000010&
  81.          Top             =   3225
  82.          Visible         =   0   'False
  83.          Width           =   2040
  84.       End
  85.       Begin Data Data2 
  86.          Caption         =   "Data2"
  87.          Connect         =   ""
  88.          DatabaseName    =   ""
  89.          Exclusive       =   0   'False
  90.          Height          =   315
  91.          Left            =   3000
  92.          Options         =   0
  93.          ReadOnly        =   0   'False
  94.          RecordSource    =   ""
  95.          Top             =   1875
  96.          Visible         =   0   'False
  97.          Width           =   1890
  98.       End
  99.       Begin Data Data1 
  100.          Caption         =   "Data1"
  101.          Connect         =   ""
  102.          DatabaseName    =   ""
  103.          Exclusive       =   0   'False
  104.          Height          =   270
  105.          Left            =   3000
  106.          Options         =   0
  107.          ReadOnly        =   0   'False
  108.          RecordSource    =   "custom"
  109.          Top             =   1500
  110.          Visible         =   0   'False
  111.          Width           =   1890
  112.       End
  113.       Begin CommandButton cancelbt 
  114.          Caption         =   "Cancel"
  115.          FontBold        =   -1  'True
  116.          FontItalic      =   0   'False
  117.          FontName        =   "MS Sans Serif"
  118.          FontSize        =   9.75
  119.          FontStrikethru  =   0   'False
  120.          FontUnderline   =   0   'False
  121.          Height          =   400
  122.          Left            =   5175
  123.          TabIndex        =   8
  124.          Top             =   2655
  125.          Width           =   1600
  126.       End
  127.       Begin CommandButton deletebt 
  128.          Caption         =   "Delete Person"
  129.          FontBold        =   -1  'True
  130.          FontItalic      =   0   'False
  131.          FontName        =   "MS Sans Serif"
  132.          FontSize        =   9.75
  133.          FontStrikethru  =   0   'False
  134.          FontUnderline   =   0   'False
  135.          Height          =   400
  136.          Left            =   5175
  137.          TabIndex        =   7
  138.          Top             =   1200
  139.          Visible         =   0   'False
  140.          Width           =   1600
  141.       End
  142.       Begin CommandButton OKbt 
  143.          Caption         =   "OK"
  144.          FontBold        =   -1  'True
  145.          FontItalic      =   0   'False
  146.          FontName        =   "MS Sans Serif"
  147.          FontSize        =   9.75
  148.          FontStrikethru  =   0   'False
  149.          FontUnderline   =   0   'False
  150.          Height          =   400
  151.          Left            =   5175
  152.          TabIndex        =   6
  153.          Top             =   1650
  154.          Width           =   1600
  155.       End
  156.       Begin AwareText fpText1 
  157.          AlignTextH      =   1  'Center
  158.          AlignTextV      =   1  'Center
  159.          BackColor       =   &H00C0C0C0&
  160.          BorderStyle     =   0  'No Border
  161.          ControlType     =   2  'Static
  162.          FontBold        =   -1  'True
  163.          FontItalic      =   0   'False
  164.          FontName        =   "MS Sans Serif"
  165.          FontSize        =   9.75
  166.          FontStrikethru  =   0   'False
  167.          FontUnderline   =   0   'False
  168.          ForeColor       =   &H00FF0000&
  169.          Height          =   645
  170.          Left            =   150
  171.          MultiLine       =   -1  'True
  172.          TabIndex        =   11
  173.          TabStop         =   0   'False
  174.          Text            =   "Choose your customized calendar from the list below..."
  175.          ThreeDOutsideHighlightColor=   &H00FFFFFF&
  176.          ThreeDOutsideStyle=   2  'Raised
  177.          ThreeDText      =   2  'Embossed
  178.          ThreeDTextHighlightColor=   &H00FFFFFF&
  179.          ThreeDTextShadowColor=   &H00404040&
  180.          Top             =   150
  181.          Width           =   6855
  182.       End
  183.       Begin CommandButton addbt 
  184.          Caption         =   "Add Person"
  185.          FontBold        =   -1  'True
  186.          FontItalic      =   0   'False
  187.          FontName        =   "MS Sans Serif"
  188.          FontSize        =   9.75
  189.          FontStrikethru  =   0   'False
  190.          FontUnderline   =   0   'False
  191.          Height          =   375
  192.          Left            =   5175
  193.          TabIndex        =   3
  194.          Top             =   2130
  195.          Visible         =   0   'False
  196.          Width           =   1600
  197.       End
  198.       Begin AwareText descbox 
  199.          FontBold        =   -1  'True
  200.          FontItalic      =   0   'False
  201.          FontName        =   "MS Sans Serif"
  202.          FontSize        =   8.25
  203.          FontStrikethru  =   0   'False
  204.          FontUnderline   =   0   'False
  205.          Height          =   375
  206.          Left            =   150
  207.          TabIndex        =   1
  208.          ThreeDOutsideHighlightColor=   &H00FFFFFF&
  209.          ThreeDOutsideStyle=   2  'Raised
  210.          ThreeDTextHighlightColor=   &H00FFFFFF&
  211.          ThreeDTextShadowColor=   &H00808080&
  212.          Top             =   2250
  213.          Visible         =   0   'False
  214.          Width           =   4455
  215.       End
  216.       Begin AwareText fpText3 
  217.          BackColor       =   &H00C0C0C0&
  218.          BorderStyle     =   0  'No Border
  219.          ControlType     =   2  'Static
  220.          FontBold        =   -1  'True
  221.          FontItalic      =   0   'False
  222.          FontName        =   "MS Sans Serif"
  223.          FontSize        =   8.25
  224.          FontStrikethru  =   0   'False
  225.          FontUnderline   =   0   'False
  226.          ForeColor       =   &H000000FF&
  227.          Height          =   315
  228.          Index           =   0
  229.          Left            =   150
  230.          TabIndex        =   10
  231.          TabStop         =   0   'False
  232.          Text            =   "Enter a name :"
  233.          ThreeDOutsideHighlightColor=   &H00FFFFFF&
  234.          ThreeDOutsideStyle=   1  'Lowered
  235.          ThreeDTextHighlightColor=   &H00FFFFFF&
  236.          ThreeDTextShadowColor=   &H00808080&
  237.          Top             =   1005
  238.          Visible         =   0   'False
  239.          Width           =   2415
  240.       End
  241.       Begin AwareComboBox fpComboBox1 
  242.          BackColor       =   &H00FFFFFF&
  243.          ColumnEdit      =   0
  244.          Columns         =   2
  245.          DataFieldList   =   ""
  246.          DataSource      =   "Data1"
  247.          DataSourceList  =   "Data1"
  248.          Header3DStyle   =   3  '3D Raised
  249.          HeaderBackColor =   &H00FFFFFF&
  250.          HeaderFontName  =   "MS Sans Serif"
  251.          HeaderFontSize  =   8.25
  252.          HeaderShow      =   -1  'True
  253.          Height          =   330
  254.          Left            =   360
  255.          LineStyleH      =   3  '3D Raised
  256.          ListWidth       =   4495
  257.          RowHeight       =   -1
  258.          Sel3DStyle      =   2  'Raised
  259.          Sel3DWidth      =   1
  260.          SelBackColor    =   &H00800000&
  261.          SelForeColor    =   &H00FFFFFF&
  262.          Style           =   2  'Dropdown List
  263.          TabIndex        =   5
  264.          Text            =   ""
  265.          Top             =   1005
  266.          Width           =   3495
  267.       End
  268.       Begin AwareText fpText3 
  269.          BackColor       =   &H00C0C0C0&
  270.          BorderStyle     =   0  'No Border
  271.          ControlType     =   2  'Static
  272.          FontBold        =   -1  'True
  273.          FontItalic      =   0   'False
  274.          FontName        =   "MS Sans Serif"
  275.          FontSize        =   8.25
  276.          FontStrikethru  =   0   'False
  277.          FontUnderline   =   0   'False
  278.          ForeColor       =   &H000000FF&
  279.          Height          =   315
  280.          Index           =   1
  281.          Left            =   150
  282.          TabIndex        =   9
  283.          TabStop         =   0   'False
  284.          Text            =   "Enter a brief description :"
  285.          ThreeDOutsideHighlightColor=   &H00FFFFFF&
  286.          ThreeDOutsideStyle=   1  'Lowered
  287.          ThreeDTextHighlightColor=   &H00FFFFFF&
  288.          ThreeDTextShadowColor=   &H00808080&
  289.          Top             =   1950
  290.          Visible         =   0   'False
  291.          Width           =   2415
  292.       End
  293.       Begin AwareText namebox 
  294.          FontBold        =   -1  'True
  295.          FontItalic      =   0   'False
  296.          FontName        =   "MS Sans Serif"
  297.          FontSize        =   8.25
  298.          FontStrikethru  =   0   'False
  299.          FontUnderline   =   0   'False
  300.          Height          =   390
  301.          Left            =   150
  302.          TabIndex        =   0
  303.          ThreeDOutsideHighlightColor=   &H00FFFFFF&
  304.          ThreeDOutsideStyle=   2  'Raised
  305.          ThreeDTextHighlightColor=   &H00000014&
  306.          ThreeDTextShadowColor=   &H00000010&
  307.          Top             =   1350
  308.          Visible         =   0   'False
  309.          Width           =   2790
  310.       End
  311.    End
  312. Dim criteria As String
  313. Sub addbt_Click ()
  314. Dim answer, criteria As String
  315.     If password.Text = "" Then
  316.         MsgBox "You need to first enter a password!"
  317.         Exit Sub
  318.     End If
  319.     selectedpassword = password.Text
  320.     selectedname = namebox.Text
  321.     passwrd.Show 1
  322.     If Not was_valid Then
  323.         Exit Sub
  324.     End If
  325.     data1.Refresh
  326.     criteria = "Name = " + "'" + selectedname + "'"
  327.     data1.Recordset.FindFirst criteria
  328.     If data1.Recordset.NoMatch Then
  329.         data1.Recordset.AddNew
  330.         data1.Recordset.Fields("name").Value = namebox.Text
  331.         data1.Recordset.Fields("description").Value = descbox.Text
  332.         data1.Recordset.Fields("password").Value = password.Text
  333.         data1.Recordset.Fields("header").Value = "2"
  334.         data1.Recordset.Fields("GrayStyle").Value = "1"
  335.         data1.Recordset.Fields("monthheader").Value = "1"
  336.         data1.Recordset.Fields("yearheader").Value = "1"
  337.         data1.Recordset.Fields("weekheader").Value = "3"
  338.         data1.Recordset.Fields("firstday").Value = "0"
  339.         data1.Recordset.Fields("appbackcolor").Value = "16711680"
  340.         data1.Recordset.Fields("appforecolor").Value = "16777215"
  341.         data1.Recordset.Fields("yrbackcolor").Value = "12632256"
  342.         data1.Recordset.Fields("yrforecolor").Value = "0"
  343.         data1.Recordset.Fields("monbackcolor").Value = "12632256"
  344.         data1.Recordset.Fields("monforecolor").Value = "0"
  345.         
  346.         data1.Recordset.Update
  347.     Else
  348.        MsgBox "Someone else is already using that name.  Please use another."
  349.         namebox.Text = ""
  350.         descbox.Text = ""
  351.         password.Text = ""
  352.         namebox.SetFocus
  353.         Exit Sub
  354.     End If
  355.     was_valid = False
  356.     intro.Show
  357.     Me.Hide
  358. End Sub
  359. Sub cancelbt_Click ()
  360.     intro.Show
  361.     Unload Me
  362. End Sub
  363. Sub deletebt_Click ()
  364. Dim answer As Integer
  365. Dim criteria As String
  366.     data1.RecordSource = "Select * From Custom Where Name = " + "'" + selectedname + "'"
  367.     data1.Refresh
  368.     selectedpassword = data1.Recordset.Fields("password").Value
  369.     answer = MsgBox("Are you sure you want to delete this calendar?", 4 + 48)
  370.     If answer = 6 Then 'Yes
  371.         passwrd.Show 1
  372.     Else
  373.         Exit Sub
  374.     End If
  375.     If Not was_valid Then
  376.         MsgBox "Sorry, I don't think they want to be deleted yet!"
  377.         Exit Sub
  378.     End If
  379.     criteria = "Name = " + "'" + selectedname + "'"
  380.     'Delete Calendar
  381.     data1.Recordset.FindFirst criteria
  382.     If data1.Recordset.NoMatch Then
  383.        MsgBox "Can't find the selected Record"
  384.        Exit Sub
  385.     End If
  386.     data1.Recordset.Edit
  387.     data1.Recordset.Delete
  388.     'Delete Appointments
  389.     Data2.Recordset.FindFirst criteria
  390.     If data1.Recordset.NoMatch Then
  391.        MsgBox "Can't delete the selected Record"
  392.        Exit Sub
  393.     End If
  394.     Data2.Recordset.Edit
  395.     Data2.Recordset.Delete
  396.       
  397.     selectedname = "Default"
  398.     was_valid = False
  399.     Me.Hide
  400. End Sub
  401. Sub Form_Activate ()
  402.     descbox.Text = ""
  403.     namebox.Text = ""
  404.     password.Text = ""
  405.     If namebox.Visible = True Then
  406.         namebox.SetFocus
  407.     End If
  408. End Sub
  409. Sub Form_Load ()
  410.     was_valid = False
  411.     centerform Me
  412.     'Connect databases
  413.     data1.Connect = ""
  414.     data1.DatabaseName = app.Path + "\calendar.mdb"
  415.     data1.RecordSource = "custom"
  416.     Data2.Connect = ""
  417.     Data2.DatabaseName = app.Path + "\appoint.mdb"
  418.     Data2.RecordSource = "appoint"
  419.     fpcombobox1.Col = 0
  420.     fpcombobox1.ColWidth = 20
  421.     'fpComboBox1.ColDataFieldType = AWARECB_FTTEXT
  422.     fpcombobox1.ColAlignH = AWARECB_ALNHCENTER
  423.     fpcombobox1.ColHeaderText = "Name"
  424.     fpcombobox1.ColDataField = "name"
  425.     fpcombobox1.Col = 1
  426.     fpcombobox1.ColWidth = 60
  427.     'fpComboBox1.ColDataFieldType = AWARECB_FTTEXT
  428.     fpcombobox1.ColHeaderText = "Description"
  429.     fpcombobox1.ColDataField = "description"
  430. End Sub
  431. Sub Form_Resize ()
  432.     fpBinary1.Move 0, 0, ScaleWidth, ScaleHeight
  433. End Sub
  434. Sub fpComboBox1_SelChange (choice As String)
  435.     fpcombobox1.Col = 0
  436.     selectedname = choice
  437. End Sub
  438. Sub OKbt_Click ()
  439.     data1.RecordSource = "Select * From Custom Where Name = " + "'" + selectedname + "'"
  440.     data1.Refresh
  441.     selectedpassword = data1.Recordset.Fields("password").Value
  442.     If Not data1.Recordset("name") = "default" Then
  443.         passwrd.Show 1
  444.     End If
  445.     intro.Show
  446.     Me.Hide
  447. End Sub
  448.