home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form person
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "Choose a Custom Calendar"
- ClientHeight = 3900
- ClientLeft = 840
- ClientTop = 645
- ClientWidth = 7575
- Height = 4305
- Left = 780
- LinkTopic = "Form1"
- ScaleHeight = 3900
- ScaleWidth = 7575
- Top = 300
- Width = 7695
- Begin AwareBinary fpBinary1
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'No Border
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "System"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 3915
- Left = 0
- TabIndex = 4
- ThreeDFrameWidth= 5
- ThreeDInsideHighlightColor= &H00FFFFFF&
- ThreeDInsideShadowColor= &H00808080&
- ThreeDInsideStyle= 2 'Raised
- ThreeDInsideWidth= 2
- ThreeDOutsideHighlightColor= &H00FFFFFF&
- ThreeDOutsideShadowColor= &H00808080&
- ThreeDOutsideStyle= 2 'Raised
- Top = 0
- Width = 7290
- Begin AwareText fpText3
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'No Border
- ControlType = 2 'Static
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H000000FF&
- Height = 315
- Index = 2
- Left = 150
- TabIndex = 12
- TabStop = 0 'False
- Text = "Enter a password to protect your files:"
- ThreeDOutsideHighlightColor= &H00FFFFFF&
- ThreeDOutsideStyle= 1 'Lowered
- ThreeDTextHighlightColor= &H00FFFFFF&
- ThreeDTextShadowColor= &H00808080&
- Top = 2850
- Visible = 0 'False
- Width = 3390
- End
- Begin AwareText password
- AlignTextH = 1 'Center
- AlignTextV = 1 'Center
- AutoCase = 2 'Lower
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 390
- Left = 150
- PasswordChar = "*"
- TabIndex = 2
- ThreeDOutsideHighlightColor= &H00FFFFFF&
- ThreeDTextHighlightColor= &H00000014&
- ThreeDTextShadowColor= &H00000010&
- Top = 3225
- Visible = 0 'False
- Width = 2040
- End
- Begin Data Data2
- Caption = "Data2"
- Connect = ""
- DatabaseName = ""
- Exclusive = 0 'False
- Height = 315
- Left = 3000
- Options = 0
- ReadOnly = 0 'False
- RecordSource = ""
- Top = 1875
- Visible = 0 'False
- Width = 1890
- End
- Begin Data Data1
- Caption = "Data1"
- Connect = ""
- DatabaseName = ""
- Exclusive = 0 'False
- Height = 270
- Left = 3000
- Options = 0
- ReadOnly = 0 'False
- RecordSource = "custom"
- Top = 1500
- Visible = 0 'False
- Width = 1890
- End
- Begin CommandButton cancelbt
- Caption = "Cancel"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 400
- Left = 5175
- TabIndex = 8
- Top = 2655
- Width = 1600
- End
- Begin CommandButton deletebt
- Caption = "Delete Person"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 400
- Left = 5175
- TabIndex = 7
- Top = 1200
- Visible = 0 'False
- Width = 1600
- End
- Begin CommandButton OKbt
- Caption = "OK"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 400
- Left = 5175
- TabIndex = 6
- Top = 1650
- Width = 1600
- End
- Begin AwareText fpText1
- AlignTextH = 1 'Center
- AlignTextV = 1 'Center
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'No Border
- ControlType = 2 'Static
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FF0000&
- Height = 645
- Left = 150
- MultiLine = -1 'True
- TabIndex = 11
- TabStop = 0 'False
- Text = "Choose your customized calendar from the list below..."
- ThreeDOutsideHighlightColor= &H00FFFFFF&
- ThreeDOutsideStyle= 2 'Raised
- ThreeDText = 2 'Embossed
- ThreeDTextHighlightColor= &H00FFFFFF&
- ThreeDTextShadowColor= &H00404040&
- Top = 150
- Width = 6855
- End
- Begin CommandButton addbt
- Caption = "Add Person"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 5175
- TabIndex = 3
- Top = 2130
- Visible = 0 'False
- Width = 1600
- End
- Begin AwareText descbox
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 150
- TabIndex = 1
- ThreeDOutsideHighlightColor= &H00FFFFFF&
- ThreeDOutsideStyle= 2 'Raised
- ThreeDTextHighlightColor= &H00FFFFFF&
- ThreeDTextShadowColor= &H00808080&
- Top = 2250
- Visible = 0 'False
- Width = 4455
- End
- Begin AwareText fpText3
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'No Border
- ControlType = 2 'Static
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H000000FF&
- Height = 315
- Index = 0
- Left = 150
- TabIndex = 10
- TabStop = 0 'False
- Text = "Enter a name :"
- ThreeDOutsideHighlightColor= &H00FFFFFF&
- ThreeDOutsideStyle= 1 'Lowered
- ThreeDTextHighlightColor= &H00FFFFFF&
- ThreeDTextShadowColor= &H00808080&
- Top = 1005
- Visible = 0 'False
- Width = 2415
- End
- Begin AwareComboBox fpComboBox1
- BackColor = &H00FFFFFF&
- ColumnEdit = 0
- Columns = 2
- DataFieldList = ""
- DataSource = "Data1"
- DataSourceList = "Data1"
- Header3DStyle = 3 '3D Raised
- HeaderBackColor = &H00FFFFFF&
- HeaderFontName = "MS Sans Serif"
- HeaderFontSize = 8.25
- HeaderShow = -1 'True
- Height = 330
- Left = 360
- LineStyleH = 3 '3D Raised
- ListWidth = 4495
- RowHeight = -1
- Sel3DStyle = 2 'Raised
- Sel3DWidth = 1
- SelBackColor = &H00800000&
- SelForeColor = &H00FFFFFF&
- Style = 2 'Dropdown List
- TabIndex = 5
- Text = ""
- Top = 1005
- Width = 3495
- End
- Begin AwareText fpText3
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'No Border
- ControlType = 2 'Static
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H000000FF&
- Height = 315
- Index = 1
- Left = 150
- TabIndex = 9
- TabStop = 0 'False
- Text = "Enter a brief description :"
- ThreeDOutsideHighlightColor= &H00FFFFFF&
- ThreeDOutsideStyle= 1 'Lowered
- ThreeDTextHighlightColor= &H00FFFFFF&
- ThreeDTextShadowColor= &H00808080&
- Top = 1950
- Visible = 0 'False
- Width = 2415
- End
- Begin AwareText namebox
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 390
- Left = 150
- TabIndex = 0
- ThreeDOutsideHighlightColor= &H00FFFFFF&
- ThreeDOutsideStyle= 2 'Raised
- ThreeDTextHighlightColor= &H00000014&
- ThreeDTextShadowColor= &H00000010&
- Top = 1350
- Visible = 0 'False
- Width = 2790
- End
- End
- Dim criteria As String
- Sub addbt_Click ()
- Dim answer, criteria As String
- If password.Text = "" Then
- MsgBox "You need to first enter a password!"
- Exit Sub
- End If
- selectedpassword = password.Text
- selectedname = namebox.Text
- passwrd.Show 1
- If Not was_valid Then
- Exit Sub
- End If
- data1.Refresh
- criteria = "Name = " + "'" + selectedname + "'"
- data1.Recordset.FindFirst criteria
- If data1.Recordset.NoMatch Then
- data1.Recordset.AddNew
- data1.Recordset.Fields("name").Value = namebox.Text
- data1.Recordset.Fields("description").Value = descbox.Text
- data1.Recordset.Fields("password").Value = password.Text
- data1.Recordset.Fields("header").Value = "2"
- data1.Recordset.Fields("GrayStyle").Value = "1"
- data1.Recordset.Fields("monthheader").Value = "1"
- data1.Recordset.Fields("yearheader").Value = "1"
- data1.Recordset.Fields("weekheader").Value = "3"
- data1.Recordset.Fields("firstday").Value = "0"
- data1.Recordset.Fields("appbackcolor").Value = "16711680"
- data1.Recordset.Fields("appforecolor").Value = "16777215"
- data1.Recordset.Fields("yrbackcolor").Value = "12632256"
- data1.Recordset.Fields("yrforecolor").Value = "0"
- data1.Recordset.Fields("monbackcolor").Value = "12632256"
- data1.Recordset.Fields("monforecolor").Value = "0"
-
- data1.Recordset.Update
- Else
- MsgBox "Someone else is already using that name. Please use another."
- namebox.Text = ""
- descbox.Text = ""
- password.Text = ""
- namebox.SetFocus
- Exit Sub
- End If
- was_valid = False
- intro.Show
- Me.Hide
- End Sub
- Sub cancelbt_Click ()
- intro.Show
- Unload Me
- End Sub
- Sub deletebt_Click ()
- Dim answer As Integer
- Dim criteria As String
- data1.RecordSource = "Select * From Custom Where Name = " + "'" + selectedname + "'"
- data1.Refresh
- selectedpassword = data1.Recordset.Fields("password").Value
- answer = MsgBox("Are you sure you want to delete this calendar?", 4 + 48)
- If answer = 6 Then 'Yes
- passwrd.Show 1
- Else
- Exit Sub
- End If
- If Not was_valid Then
- MsgBox "Sorry, I don't think they want to be deleted yet!"
- Exit Sub
- End If
- criteria = "Name = " + "'" + selectedname + "'"
- 'Delete Calendar
- data1.Recordset.FindFirst criteria
- If data1.Recordset.NoMatch Then
- MsgBox "Can't find the selected Record"
- Exit Sub
- End If
- data1.Recordset.Edit
- data1.Recordset.Delete
- 'Delete Appointments
- Data2.Recordset.FindFirst criteria
- If data1.Recordset.NoMatch Then
- MsgBox "Can't delete the selected Record"
- Exit Sub
- End If
- Data2.Recordset.Edit
- Data2.Recordset.Delete
-
- selectedname = "Default"
- was_valid = False
- Me.Hide
- End Sub
- Sub Form_Activate ()
- descbox.Text = ""
- namebox.Text = ""
- password.Text = ""
- If namebox.Visible = True Then
- namebox.SetFocus
- End If
- End Sub
- Sub Form_Load ()
- was_valid = False
- centerform Me
- 'Connect databases
- data1.Connect = ""
- data1.DatabaseName = app.Path + "\calendar.mdb"
- data1.RecordSource = "custom"
- Data2.Connect = ""
- Data2.DatabaseName = app.Path + "\appoint.mdb"
- Data2.RecordSource = "appoint"
- fpcombobox1.Col = 0
- fpcombobox1.ColWidth = 20
- 'fpComboBox1.ColDataFieldType = AWARECB_FTTEXT
- fpcombobox1.ColAlignH = AWARECB_ALNHCENTER
- fpcombobox1.ColHeaderText = "Name"
- fpcombobox1.ColDataField = "name"
- fpcombobox1.Col = 1
- fpcombobox1.ColWidth = 60
- 'fpComboBox1.ColDataFieldType = AWARECB_FTTEXT
- fpcombobox1.ColHeaderText = "Description"
- fpcombobox1.ColDataField = "description"
- End Sub
- Sub Form_Resize ()
- fpBinary1.Move 0, 0, ScaleWidth, ScaleHeight
- End Sub
- Sub fpComboBox1_SelChange (choice As String)
- fpcombobox1.Col = 0
- selectedname = choice
- End Sub
- Sub OKbt_Click ()
- data1.RecordSource = "Select * From Custom Where Name = " + "'" + selectedname + "'"
- data1.Refresh
- selectedpassword = data1.Recordset.Fields("password").Value
- If Not data1.Recordset("name") = "default" Then
- passwrd.Show 1
- End If
- intro.Show
- Me.Hide
- End Sub
-