Visual Basic Class
Project
Spring, 2000
Anne VanTine
This application enables a user to narrow down a list of
activities available on Cape Cod to see the ones of interest, and select items
from that list to create an individual vacation plan. Any number of individual plans can be saved and retrieved and modified.
Image of the Main Form
Image of Message & Dialog
Boxes
Image of Database Relationships
Sample Report
Back to Anne's Home Page
Functionality
of the Main Form
The main form is roughly divided into three sections to
narrow the range of events, to view and select events, and to view and
manipulate an individualized plan.
- At the
top, the user selects dates, event types, and towns of interest. User may
select a range of contiguous dates or an individual date. (Selection of event types and towns is
not fully implemented yet – the selection will include all event types and
towns.)
- Dates
are selected with the MonthView1 control
- Event
types and towns are selected from list boxes. Candidates are shown on the left and selected items on the
right. Command buttons with
arrows let the user move items back and forth.
- Clicking
the Show Events button displays all the events that meet the selected
criteria in a list box in the
middle section of the form.
- The
middle section of the form displays the events that meet the selected
criteria. Clicking on an event
displays its scheduled dates and times in a second list box. Clicking Add Event to Vacation Plan
button adds a selected event with date and time to the personal vacation
plan displayed at the bottom of the form.
- List
boxes are used to display events and dates/times.
- Arrays
hold the ids of the events and dates/times instances. The index of an event in the event
list box and in the event array are the same, so when an event is
selected from the list box, its id can easily be retrieved from the
array. Similarly for the
dates/times.
- Add
Event to Vacation Plan button displays the selected item in the plan.
- The
bottom section displays the individually selected plan in a grid. User can sort the grid, delete
individual items, clear the grid, delete a plan from the database, and
generate a report.
- MSFlexgrid1
control is used to display the plan.
- The
Sort button sorts the grid by Instance Id (need to enhance the sorts)
- The
Delete Selection button deletes the selected row from the grid without
changing the database.
- The
Clear Displayed Plan button deletes all selections from the grid without
changing the database.
- The
Delete Plan Permanently button deletes the plan with the currently
selected name from the database.
- The
View Report button creates a report which contains the items currently
displayed in the grid. Because I
couldn’t input a parameter for the plan name at run time, I do a
workaround. The displayed plan is
temporarily saved to table used just for reports, and the pre-defined
query for the report always uses that table.
Menu Functions
The application has menu selections to select start a New
plan, Open an existing plan, Save a plan, Save as with a new name, and
exit. If the user tries to open a new
or existing plan or exit when the current plan has not been saved, the
application.
- New –
User selects a new plan name. The
new plan name is displayed in the form’s caption and on the form. If the
current plan is unsaved, user is asked if he wants to save it. If yes, if it needs a name, that is
handled, and the old plan is saved.
- Open –
User is shown a list of plan names from the database to select from. The
selected plan name is displayed and the selected plan is loaded to display
in the grid. If the current plan
is unsaved, user is asked if he wants to save it. If yes, if it needs a name, that is
handled, and the old plan is saved.
- Save –
If the current plan already has a name, it is saved and nothing changes on
the display. However, if it was a
new plan that didn’t have a name yet, user is asked for a name. A check is done to see if that name
already exists in the database. If
not, but plan is saved and the newly selected name is displayed. If the plan name does already exist, a
dialog takes place to see whether the user wants to replace existing plan
of that name or select a different name.
- Save
As – Enables the user to save the current plan with a new name. Includes the functionality of Save.
- Exit –
Before exiting, if there is a current plan with unsaved changes, the user
is asked if he wants to save it.
If yes, if it needs a name, that is handled, and the plan is
saved.
Further Information
This project evolved my Guide to Cape Cod that I did for an
HTML course previously. That web site
is at http://www.vantine.net.
The data in my database is real (except for Seal Cruise
times), but it's only a small subset of available events from the National
Seashore, Wellfleet Bay Wildlife Sanctuary, and Cape Cod Museum of Natural
History.
There's more information about the sponsors of these events
and links to their web site at http://www.tiac.net/users/vantine/guide/textpages/tours.html (or go to the Cape Cod site at vantine.net
and select "Tours").
Back to Anne's Home Page