Agenda Application

The Agenda Application was created in Visual Basic 6.0 with an Access 2000 database. This project was a freelance contract commissioned after graduation from ITI. It was coded using an object-oriented, 3-tier architecture. It is an MDI environment with a menu bar that displays one of seven forms at a time. The client wished to store Addresses, Anniversaries, and Birthdays, as well as keep track of and receive reminders for Tasks, Appointments and Bills. A program shortcut is placed in the computers' startup directory to activate the program whenever the computer is powered on. The MDI form will display, and the database is hit for Task, Appointment, and Bill reminders. Any reminders found will be shown in a messagebox to the user. This reminder feature will also run whenever the program is started.
As the application loads, the program will connect to the database and loop through Appointments, Bills and Tasks. Stored reminder dates will be compared to the computers' System Date and will display a Message Box. The type of reminder and the due date will show up in the message. The header will display the current date.
The menu on the MDI Form allows each of the six main forms to be accessed. 

The Task Form can hold values for a Task Name, a desired reminder date, and a section for related Notes.

Like all of the forms, the Address Form would load all of the Names into a Combo Box. When a name was selected, the details would display in the remaining controls. Phone numbers and postal codes would be formatted prior to saving and Provinces and States were already stored in separate tables. The selection of a province or state would cause the country Combo Box to display the appropriate value.
The Anniversary Form and Birthday forms were very similar in function and could be toggled back and forth by the buttons in the View Frame. When an anniversary date was entered and saved, the number of years would be calculated and displayed.
Like the Anniversary Form, the Birthday Form would perform a calculation to determine the person's age based on the Date of Birth entry. As with all the other forms, clicking the New Entry button would provide an Input Box for a new name. The Save button would save any details added once the name was in the Combo Box. The Delete button would display a Message Box and ask the user for a confirmation before removing the record.
The Bills Form kept track of the Bill Name, Amount, Due Date, Reminder Date and Notes. 

All date selections in the Application were an Active X Control Date Picker. This served as a more straightforward means of selecting dates and was useful for self-validating that the input was a date.

The Appointment Form contained more fields than many other forms but behaved in much the same way as the others. 

The Menu contained an edit selection that would allow the user to Cut, Copy and Paste selections to and from text areas. It was coded to utilize the Windows Clipboard.

The File menu item allowed the user to exit the program.

Code: Sub Procedure � New Entry for Address Form


Private Sub cmdNewEntry_Click()
   Dim intCount As Integer
   Dim lngPos As Long
   Dim strAddressName As String

   'clear the text fields, check boxes, and combo boxes
  
txtSpouse.Text = ""
   txtAddress.Text = ""
   txtCity.Text = ""
   txtPostal.Text = ""
   txtHPhone.Text = ""
   txtWPhone.Text = ""
   txtCPhone.Text = ""
   txtEmail.Text = ""
   txtChildren.Text = ""
   cboProvince.ListIndex = 0
   cboCountry.ListIndex = 0
   chkCard.Value = vbUnchecked
   chkLetter.Value = vbUnchecked

   'set the database to receive a new entry
   'and will be tested for in the AddressDB class
   mobjAddress.AddressId = 0

   'provide an input box to place the NAME in the combo box
   mobjAddress.AddressName = InputBox("Type the name of the new Person")

   'make sure something was entered in the input box
  
If mobjAddress.AddressName = "" Then
      Call Form_Load
      Exit Sub
   Else

   'change an apostrophe, if any, to reversed form: "`" to avoid SQL errors
  
For intCount = 1 To Len(mobjAddress.AddressName)
      'test whether there's an apostrophe in the text
      'if there isn't, exit the loop
     
If InStr(mobjAddress.AddressName, "'") = 0 Then
         Exit For
         'if there is, find where each one is
         'and change it to the reverse form: "`"
     
Else

         lngPos = InStr(1, mobjAddress.AddressName, "'")
         strAddressName = mobjAddress.AddressName
         Mid(strAddressName, lngPos, 1) = "`"
         mobjAddress.AddressName = strAddressName
      End If

   'loop through until there are no more apostrophes
  
Next intCount

   'save the name in the database with a new ID
  
Call cmdSave_Click

   End If
End Sub

Place 'em Placement Agency