You are on page 1of 71

General Certificate of Education

Advanced Level
COMPUTING
For examination in June and November 2010

Name: Mohammad Hadi

Center name: PK 025

Final Project (Database System)

Inventory Control System for Hot Shots


(Fast food restaurant)

Table of Contents
Analysis: ........................................................................................................................................................ 2
How the data will be collected and used: ..................................................................................................... 5
Hardware Requirement ................................................................................................................................ 6
Software Requirement .................................................................................................................................. 8
Software used: .............................................................................................................................................. 9
Action plan: ................................................................................................................................................... 9
Design: ........................................................................................................................................................ 10
Mapping: ..................................................................................................................................................... 10
How the program works (Background):...................................................................................................... 21
Programming Techniques: .......................................................................................................................... 22
Form Development: .................................................................................................................................... 34
Implementation: ......................................................................................................................................... 61
Testing:........................................................................................................................................................ 62
User Documentation: .................................................................................................................................. 68

1|Page
Inventory Control System for Hot Shots (Fast food restaurant)

Analysis:
Problem definition

Hot Shots is a fast food restaurant it has a manual database system for its inventory. They have different
registers for data input. They include Inventory information register, Product information register,
Vendor information register, Invoice information register and sale information register. These registers
have all the information to control the database system. All the changes in this system have to be made
manually. The manual system they have is very difficult to handle and to work on. It is not very efficient
and cannot fulfill the requirements needed for this growing company. The new inventory control system
developed is an automated one. It will meet all requirements for their company and will greatly improve
the performance of the system.

Objectives:

• To have a faster and more efficient inventory control system

• To make handling of data easier through data manipulation tools such as sorting copying etc.

• To make data manipulation easier

• To prevent mistakes and increase system reliability through validation checks

• Customer satisfaction through quick processing.

• Better standards and better quality control by having easily accessible knowledge about the
inventory

• To store data

The new system will solve all the problems faced in the previous system and even further
improve the system. Another solution can be that the computers can be networked and data
can be shared between the pos terminal and the stock control system. This will further help in
the system and make the program more versatile.

Advantages of the new system:

• Friendly user interface.

• Menus help to navigate through the system.

• Forms can be opened through the menu.

• Data input is easier..

2|Page
• Validation checks help in making sure that the data entered is correct.

• Data retrieval is easier and faster.

• Printouts can be taken through forms.

• Reports can be generated.

• The data and records are displayed in logical order.

Disadvantages of the old system:

• difficult to enter data

• mistakes can be made during data input

• Difficult to search for a record

• Copies cannot be made easily

The data that is required:


The tables that are being used:

• Inventory information table


• Invoice information table
• Invoice item information table
• Product information table
• Recipe information table
• Sales Details information table
• Sale information table
• Vendor information table

According to tables:

Inventory information table

• A unique key field generated automatically to relate tables


• Name of the item
• Its type
• Quantity
• A little description for the user to confirm what the item is

3|Page
Invoice information table

• A unique key field generated automatically to relate tables


• Date
• Price
• Paid or not paid?
• Invoice item id for relationship in tables

Invoice item information table

• A unique key field generated automatically to relate tables


• item id for relationships
• quantity added

Product information table

• A unique key field generated automatically to relate tables


• Name
• Recipe id (to get recipe and show how much of which item is used in the product)
• Some description
• Price

Recipe information table

• A unique key field generated automatically to relate tables


• Item id for relationships
• Quantity in use

Sales Details information table

• No unique id required for this table


• Sale id for relationships between tables
• Quantity sold

Sale information table

• A unique key field generated automatically to relate tables


• Sale date

Vendor information table

• A unique key field generated automatically to relate tables


• Name
• Addresses
• Contact numbers

4|Page
• Emails

How the data will be collected and used:


This data will be collected from different places. For example for vendor’s data their cards will be used
to enter data about them. The sale related information will be collected from the counter etc. The
product information and the inventory information would be entered by the staff that is taking care of
the inventory and the products.

The data will be entered into a computerized system through a keyboard. A user interface will help the
staff to navigate through the program and open different forms and tables to enter or retrieve the data.
During data input different validation checks will help to validate the data such as type check, range
check, null check and etc. Users will be able to search through different records using the search engines
present in the program itself. Different queries will help to search for different records. Sorting is
automatically done by the program when the user opens the tables. The user can also change the
sorting criteria

The output from the program would be in the form of reports and forms. The forms and reports can be
printed. The reports will help show the performance of the store. It will show the trend for sales. The
demand of the customers could be judged by the amount of products sold. The inventory could be
checked and new orders could be made by using the data. Forms could be used to print information on
a specific record such as an item or a vendor .As for the security and backups a separate computer
system will e setup to keep information of older records and backups. Passwords will allow only the
authorized staff to use the program.

5|Page
Hardware Requirement
Minimum:
2.0 GHz Intel Pentium IV or equivalent

• The system has to be fast enough to be practical and efficient.


• The substitution generation is a complex task and requires a lot of processing.
• The speed deficit due to human intervention has to be overcome by the processing
power of the computer system.

• Availability and technical support of less powerful processors is not available.


512 MB of RAM
• For a computer running Windows XP (the preferred Operating system at least this
much of RAM is needed.

1 GB of free space.
• This space is required for the record the daily operations.
VGA card
• Supporting 1280 x 1024 resolution and 16 bit color quality.
• The interface is legibly viewed at this resolution and color quality setting.
Monitor
• To enable the user to have a medium through which to see the output of his/her
actions.

Keyboard
• To enable the user to input data.
Mouse or compatible pointing device
• The software supports a GUI (graphical user interface) therefore a mouse or other
pointing device is a necessity without which the software can’t be fully operated.

CD Drive
• To allow the application to be installed
Different software and programs to ease his tasks such as drivers of different hardware

• So sounds produced during an error can be heard.

6|Page
Monochrome Printer

• So the reports which include the substitutions slips can be printed out.

DVD-RW drive
• To allow the application to install and to take regular backups.
Speakers/headphones
• So sounds produce during an error can be heard

Recommended:
1.73 GHz Intel core 2 duo or equivalent
• The system has to be fast enough to be practical and efficient.
• The dual processers help perform multiple tasks at the same time.
• The substitution generation is a complex task and requires a lot of processing.
• The speed deficit due to human intervention has to be overcome by the processing
power of the computer system.

• Thus this processor is more suitable as it is more powerful.


1 Gb of Ram
• For a computer running Windows XP (the preferred Operating system at least this
much of RAM is recommended for proper functioning of the system.

2 GB of free space
• A space of 2 GB will ensure there are no problems with storage for a substantial
amount of time.

VGA card
• Supporting 1280 x 1024 resolution and 32 bit color quality.
• The interface is best viewed at this resolution and color quality setting.
LCD Monitor
• LCD monitors are preferred as they are much less harmful to the eyes than CRT
monitors which emit radiation and cause damage to sight.

7|Page
Anti-RSI Keyboard
• To enable the user to input data such without suffering from RSI (repetitive strain
injury).

Mouse or compatible pointing device


• The software supports a GUI (graphical user interface) therefore a mouse or other
pointing device is a necessity without which the software can’t be fully operated.

Colour Printer
• So the reports which include the substitutions slips can be printed out and the color
coding in different reports be taken advantage of

Software Requirement
System Software
• OS (Microsoft Windows)
Utility Software
• Antivirus (so that program may not be corrupted with small viruses they can
be easily removed)

• Backup utility (If the data is lost or stolen then in this case backup must be
present to overcome any upcoming trouble)

• Recovery Utility (If the data or program is corrupted then there must be
software to recover it)

• File compression (This is a technique to reduce the space occupied by any


program or document)

• File defragmentation (If the data get scattered then this is useful to reorder
the data)

The hardware listed above would be required to run this program.

8|Page
Software used:
The software used to make this database system are Microsoft Office Access 2007 and visual basic 6.0.
Microsoft office access provides the base for the database and visual basic provides the user interface
and coding for the database. It has great options for making new tables, forms, reports. It has a very
friendly user interface. And using this software there are great possibilities of generating database
systems. A virtual wizard present in this software helps to make new forms, tables etc. buttons can be
made on the on screen forms. Menus can be made for the database system using the switchboard
manager already present in the software.

Action plan:
The plan for the system was that to develop a system that would be very user friendly, easy to use and
very much versatile. It was planed that it be made in such a way that the user could start using the
program with little or no training. The design to be kept simple but at the same time providing great
power and accessibility in handling the data. The program was planed in such a way that it would not
only solve the problems faced in the earlier system but also provide new features which would help
even more with

9|Page
Design:
Relationships and the tables used in the system:

The figure above shows all the relationships in this system including all the tables and their entities.

Mapping:
Inventory Information Table:
Item Id Item Name Vendor ID Item Type

Quantity in stock Description

10 | P a g e
Invoice item information Table:

Invoice item ID Item Id Quantity Added

Invoice information table

Invoice Id Invoice item ID Date

Price Paid

Product information table


Product Id Product Name Recipe ID

Description product rate

Recipe information table

Recipe ID Item ID Quantity in use

Sale Details

Sale ID Product Id Quantity sold

11 | P a g e
Sale information table

Sale ID Sale date

Vendor information table

Vendor ID Name Address

City Mobile num Phone num

e-mail

Tables in the database when executed show the data in simplest form. In the following pictures all the
tables are shown with some sample data in it.

12 | P a g e
Inventory information table:

Product information table:

Recipe information table:

Continued on next page…..

13 | P a g e
Invoice and Invoice item Information tables:

Sale details and Sale information tables:

Vendor Information table:

14 | P a g e
In this database system data entry is easier. Forms not only help to enter new data and records but you
can also retrieve, edit and make print outs of the data. The following screen shot shows the list of forms
made.

The functionality of these forms is shown in the following screen shot.

This is the Inventory Info form. Using this form you can add new records, delete them save them. print
them or even search for record. The navigational keys below help to go through different records. The
design is kept simple so it can be more users friendly. The operational keys have been grouped in one
place and vivid colours are used for headings and titles so they can be easily understood.

15 | P a g e
This is the Invoice info form it has another feature in it. Related record can be directly opened through
the form. When the “invoice item info” button is pressed the record is retrieved which has the same Id
and are related to each other. This form also has a check box for easy usage. Al the forms designs are
kept similar to each other so that there won’t be any difficulty in using them.

16 | P a g e
Other forms include:

Vendor information form:

Sale Info Form

17 | P a g e
Another interesting feature of the database system is the “Switchboard” it launches it self as soon as the
program has been run. It is a kind of menu, it greatly helps in navigating through the whole data base
system.

This menu runs as soon as the program is launched. From here you can open anything that is in the
database. This is the easiest way to navigate through the database.

18 | P a g e
In this database system you can also generate reports. Reports show all the data stored in a table in an
orderly manner.

These are some of the reports that can be generated. The following screen shot shows a generated
report.

The report shown in this screen shot shows all the records in the vendor information table.

Continued on next page…

19 | P a g e
This screen shot shows the report generated for the sales.

This is the report generated for the inventory. Data is arranged in orderly manner in these reports. Print
outs can be taken of these reports.

20 | P a g e
How the program works (Background):
Technical documentation :
This section shows how the database works. It shows all the data flow of the system. This
documentation also shows relationships between different tables and their entities.

Data flow diagram: this is how the data is processed for any data entry in this program.

Data entry

Error Report
Validation

Validated data

Sorting

Sorted data

Old master file


Updating

Forms and Reports


New master file data in logical
order

21 | P a g e
Programming Techniques:
While developing the program, the following programming techniques were implied:

Note: Following techniques were used at multiple places but all of the places in which these techniques
were used are not mentioned here.

1. Records:
Records were used to store information about each of the entity in the program.

2. Different Data types:


Different data types had to be used during developing of the program .For

Example, Date data type is used for the fields in which date is required and numeric data type is used
where only numbers are required.

3. Selection:
The user has been given the ability to select through different options for example in the main menu or
in the forms themselves

4. Iteration:
Iteration is used in some places of the program a good example would be while entering the password.
A loop has been set there which will prevent any unauthorized person to enter the password
repeatedly. Ref page 59

5. Procedures/Function:
Built in procedure/functions are used for different tasks i.e. adding a record,

Deleting a record, updating a record etc.

6. Files/Tables:
There are many files and tables used in the program. Most of them are visible in the screen shots that
follow.

7. Searching:
The option for searching for records is also been

22 | P a g e
Algorithms of the following tasks

23 | P a g e
24 | P a g e
25 | P a g e
The new inventory control system developed is an automated one. It includes different tables such as
Inventory item info table, Invoice info table and etcetera as shown in the picture.

26 | P a g e
Fig : 1.0

Continued on next page…

27 | P a g e
The tables used in the database

28 | P a g e
29 | P a g e
The fig: 1.0 show’s all the tables used in the database system. These tables include different entities. The
tables are linked together with each other through these entities and they form relationships. All the
relationships between different tables and there entities are shown in the following figure.

The inventory item table is the center of the database. It has all the information of the items stored in
the inventory.

It is changed because of two processes, one if a product is sold the items in the inventory get used up
and second if new items come into the inventory from the vendors.

30 | P a g e
In the processes of selling the product, the recipe info table shows the item and the amount used in the
product to be made.

The information about the product is given in the product info table it gives the details about the
product.

The sold products information goes to the Sale details table. The sale info table and the sale detail tables
are separated because they have a one to much relationship a single sale can have various products in it.
The sale details table forms by gathering combined data from both sale info table and the product info
table to give details of the sale.

This is how the item info table if


affected by the sales.

31 | P a g e
The second process by which the main table, the item info table is affected is by the income of new
items from different vendors. The information of the new items is divided onto two tables the Invoice
info table and the invoice item info table.

These tables show all the details of the new items that are added to the inventory. Additionally there is
a vendor info table which holds the records of all the vendors of the items. The picture that follows
shows the vendor info table.

It holds all the information about the vendor including there contact numbers and there id’s.

Continued on next page…

32 | P a g e
In manual database systems there are chances that the data being input mite be wrong so in this
database system there are some validation checks at the time of data input. The following screen shots
will show some of the input masks applied on various tables.

Another input used would be

These input masks help in validating the data.

33 | P a g e
Form Development:
Inventory Info Form

‘Following is the code of the table;

Private Sub CmdAdd_Click()

Data1.Recordset.AddNew

Txtitemid.SetFocus ’Information is added to the Inventory with focus on txtitemid when clicked

End Sub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’The information in the Data1 sheet can be edited

txtitemid.SetFocus ’Focus stays on txtitemid when clicked on the edit button

EndSub

34 | P a g e
PrivateSub CmdDelete_Click()

Dim CmdDelete As Integer

CmdDeletemsg = MsgBox ("Are you sure you want to delete?", vbYesNo + vbExclamation
,"CONFIRMATION MESSAGE") ’The user is asked to confirm the Deletion process

If CmdDeletemsg = 6 Then ’If equal to 6 it means “Yes” for the deletion

Data1.Recordset.Delete

Else ’the the file is deleted

End If

EndSub

PrivateSub Close_Click()

Menu.Show ‘Clicking it leads us back to

EndSub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’the record is edited if it is clicked

Txtitemid.SetFocus

End Sub

PrivateSub CmdSave_Click()

Data1.Recordset.Update ’The data is updated or any changes are saved using this button

EndSub

PrivateSub CmdFirst_Click()

Data1.Recordset.MoveFirst

Txtitemid.SetFocus

EndSub ’we are taken directly to first record

35 | P a g e
PrivateSub CmdLast_Click()

Data1.Recordset.MoveLast

End Sub ’Here on clicking it we are taken directly to last record

PrivateSub CmdNext_Click()

If Data1.Recordset.EOF Then

Data1.Recordset.MoveFirst ’If it is end of file then we will lead to the first record of the form

Else

Data1.Recordset.MoveNext ’helps in moving to next data

EndIf

EndSub

PrivateSub CmdPrevious_Click()

If Data1.Recordset.BOF Then

Data1.Recordset.MoveFirst

Else ’If then it will move to first record

Data1.Recordset.MovePrevious

EndIf ’We can move to the previous record in form

PrivateSub Txtquantity_KeyPress (KeyAscii As Integer)

If (KeyAscii>=48) And (KeyAscii<=57) Or ( KeyAscii = 43 ) Or (KeyAscii = 8 ) Or ( KeyAscii= 127)


Then

Else ’Validation check to allow numbers only

KeyAscii = 0 ’If we press an alphabet we are displayed with an error report asking the user to
only input numbers

MsgBox " Please enter only numbers for the quantity in stock field " , vbExclamation , "ERROR
REPORT"

EndIf

EndSub

36 | P a g e
PrivateSub cmdfindId_Click()

Dim criteria AsString

Itemid.Data1.Recordset.FindNext

criteria=""

If

Itemid.Data1.Recordset.NoMatch = True Then

MsgBox "No match available"

EndIf

EndSub

PrivateSub cmdfindname_Click()

Dim criteria AsString

Itemname.Data1.Recordset.FindNext

criteria=""

If

Itemname.Data1.Recordset.NoMatch = True Then

MsgBox "No match available"

EndIf

EndSub

37 | P a g e
Invoice Info Form

‘Following is the code of the table;

Private Sub CmdAdd_Click()

Data1.Recordset.AddNew

Txtinvoiceid.SetFocus ’Information is added to the Inventory with focus on Txtinvoiceid when


clicked

End Sub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’The information in the Data1 sheet can be edited

Txtinvoiceid.SetFocus ’Focus stays on Txtinvoiceid when clicked on the edit button

EndSub

38 | P a g e
PrivateSub CmdDelete_Click()

Dim CmdDelete As Integer

CmdDeletemsg = MsgBox ("Are you sure you want to delete?", vbYesNo + vbExclamation
,"CONFIRMATION MESSAGE") ’The user is asked to confirm the Deletion process

If CmdDeletemsg = 6 Then ’If equal to 6 it means “Yes” for the deletion

Data1.Recordset.Delete

Else ’the the file is deleted

End If

EndSub

PrivateSub Close_Click()

Menu.Show ‘Clicking it leads us back to

EndSub

PrivateSub invoiceiteminfo_Click()

invoiceiteminfo.Show ‘Clicking it leads us back to

EndSub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’the record is edited if it is clicked

Txtinvoiceid.SetFocus

End Sub

PrivateSub CmdSave_Click()

Data1.Recordset.Update ’The data is updated or any changes are saved using this button

EndSub

PrivateSub CmdFirst_Click()

Data1.Recordset.MoveFirst

Txtinvoiceid.SetFocus

39 | P a g e
EndSub ’we are taken directly to first record

PrivateSub CmdLast_Click()

Data1.Recordset.MoveLast

End Sub ’Here on clicking it we are taken directly to last record

PrivateSub CmdNext_Click()

If Data1.Recordset.EOF Then

Data1.Recordset.MoveFirst ’If it is end of file then we will lead to the first record of the form

Else

Data1.Recordset.MoveNext ’helps in moving to next data

EndIf

EndSub

PrivateSub CmdPrevious_Click()

If Data1.Recordset.BOF Then

Data1.Recordset.MoveFirst

Else ’If then it will move to first record

Data1.Recordset.MovePrevious

EndIf ’We can move to the previous record in form

PrivateSub Txtprice_KeyPress (KeyAscii As Integer)

If (KeyAscii>=48) And (KeyAscii<=57) Or ( KeyAscii = 43 ) Or (KeyAscii = 8 ) Or ( KeyAscii= 127)


Then

Else ’Validation check to allow numbers only

KeyAscii = 0 ’If we press an alphabet we are displayed with an error report asking the user to
only input numbers

MsgBox " Please enter only numbers for the price field " , vbExclamation , "ERROR REPORT"

EndIf

EndSub

40 | P a g e
PrivateSub cmdfindId_Click()

Dim criteria As String

Itemid.Data1.Recordset.FindNext

criteria=""

If

Invoiceid.Data1.Recordset.NoMatch = True Then

MsgBox "No match available"

EndIf

EndSub

41 | P a g e
Invoice Item Info

‘Following is the code of the table;

Private Sub CmdAdd_Click()

Data1.Recordset.AddNew

Txtinvoiceitemid.SetFocus ’Information is added to the Inventory with focus on


txtinvoiceitemid when clicked

End Sub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’The information in the Data1 sheet can be edited

txtinviceitemid.SetFocus ’Focus stays on txtinvoiceitemid when clicked on the edit button

EndSub

PrivateSub CmdDelete_Click()

Dim CmdDelete As Integer

CmdDeletemsg = MsgBox ("Are you sure you want to delete?", vbYesNo + vbExclamation
,"CONFIRMATION MESSAGE") ’The user is asked to confirm the Deletion process

If CmdDeletemsg = 6 Then ’If equal to 6 it means “Yes” for the deletion

Data1.Recordset.Delete

Else ’the the file is deleted

42 | P a g e
End If

EndSub

PrivateSub Close_Click()

invoiceinfoform.hide ‘Clicking it will close the form

EndSub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’the record is edited if it is clicked

Txtinvoiceitemid.SetFocus

End Sub

PrivateSub CmdSave_Click()

Data1.Recordset.Update ’The data is updated or any changes are saved using this button

EndSub

43 | P a g e
Product Info Form

‘Following is the code of the table;

Private Sub CmdAdd_Click()

Data1.Recordset.AddNew

Txtproductid.SetFocus ’Information is added to the Inventory with focus on txtproductid when


clicked

End Sub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’The information in the Data1 sheet can be edited

txtproductid.SetFocus ’Focus stays on txtproductid when clicked on the edit button

EndSub

44 | P a g e
PrivateSub CmdDelete_Click()

Dim CmdDelete As Integer

CmdDeletemsg = MsgBox ("Are you sure you want to delete?", vbYesNo + vbExclamation
,"CONFIRMATION MESSAGE") ’The user is asked to confirm the Deletion process

If CmdDeletemsg = 6 Then ’If equal to 6 it means “Yes” for the deletion

Data1.Recordset.Delete

Else ’the the file is deleted

End If

EndSub

PrivateSub Close_Click()

Menu.Show ‘Clicking it leads us back to

EndSub

PrivateSub invoiceiteminfo_Click ()

invoiceiteminfo.Show ‘Clicking it leads us back to

EndSub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’the record is edited if it is clicked

Txtproductid.SetFocus

End Sub

PrivateSub CmdSave_Click()

Data1.Recordset.Update ’The data is updated or any changes are saved using this button

EndSub

PrivateSub CmdFirst_Click()

Data1.Recordset.MoveFirst

Txtproductid.SetFocus

EndSub ’we are taken directly to first record

45 | P a g e
PrivateSub CmdLast_Click()

Data1.Recordset.MoveLast

End Sub ’Here on clicking it we are taken directly to last record

PrivateSub CmdNext_Click()

If Data1.Recordset.EOF Then

Data1.Recordset.MoveFirst ’If it is end of file then we will lead to the first record of the form

Else

Data1.Recordset.MoveNext ’helps in moving to next data

EndIf

EndSub

PrivateSub CmdPrevious_Click()

If Data1.Recordset.BOF Then

Data1.Recordset.MoveFirst

Else ’If then it will move to first record

Data1.Recordset.MovePrevious

EndIf ’We can move to the previous record in form

PrivateSub Txtproductrate_KeyPress (KeyAscii As Integer)

If (KeyAscii>=48) And (KeyAscii<=57) Or ( KeyAscii = 43 ) Or (KeyAscii = 8 ) Or ( KeyAscii= 127)


Then

Else ’Validation check to allow numbers only

KeyAscii = 0 ’If we press an alphabet we are displayed with an error report asking the user to
only input numbers

MsgBox " Please enter only numbers for the product rate field " , vbExclamation , "ERROR
REPORT"

EndIf

EndSub

46 | P a g e
PrivateSub cmdfindId_Click()

Dim criteria As String

productid.Data1.Recordset.FindNext

criteria=""

If

productid.Data1.Recordset.NoMatch = True Then

MsgBox "No match available"

EndIf

EndSub

PrivateSub cmdfindname_Click()

Dim criteria AsString

productname.Data1.Recordset.FindNext

criteria=""

If

productname.Data1.Recordset.NoMatch = True Then

MsgBox "No match available"

EndIf

EndSub

47 | P a g e
Recipe Info Form

Following is the code of the table;

Private Sub CmdAdd_Click()

Data1.Recordset.AddNew

Txtinvoiceitemid.SetFocus ’Information is added to the Inventory with focus on txtinvoiceitemid


when clicked

End Sub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’The information in the Data1 sheet can be edited

txtinviceitemid.SetFocus ’Focus stays on txtinvoiceitemid when clicked on the edit button

EndSub

PrivateSub CmdDelete_Click()

Dim CmdDelete As Integer

CmdDeletemsg = MsgBox ("Are you sure you want to delete?", vbYesNo + vbExclamation
,"CONFIRMATION MESSAGE") ’The user is asked to confirm the Deletion process

If CmdDeletemsg = 6 Then ’If equal to 6 it means “Yes” for the deletion

Data1.Recordset.Delete

48 | P a g e
Else ’the the file is deleted

End If

EndSub

PrivateSub Close_Click()

Recipeinfoform.hide ‘Clicking it will close the form

EndSub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’the record is edited if it is clicked

Txtinvoiceitemid.SetFocus

End Sub

PrivateSub CmdSave_Click()

Data1.Recordset.Update ’The data is updated or any changes are saved using this button

EndSub

49 | P a g e
Vendor Info Form

‘Following is the code of the table;

Private Sub CmdAdd_Click()

Data1.Recordset.AddNew

Txtvendorcode.SetFocus ’Information is added to the Inventory with focus on txtvendorcode


when clicked

End Sub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’The information in the Data1 sheet can be edited

50 | P a g e
txtvendorcode.SetFocus ’Focus stays on txtvendorcode when clicked on the edit button

EndSub

PrivateSub CmdDelete_Click()

Dim CmdDelete As Integer

CmdDeletemsg = MsgBox ("Are you sure you want to delete?", vbYesNo + vbExclamation
,"CONFIRMATION MESSAGE") ’The user is asked to confirm the Deletion process

If CmdDeletemsg = 6 Then ’If equal to 6 it means “Yes” for the deletion

Data1.Recordset.Delete

Else ’the the file is deleted

End If

EndSub

PrivateSub Close_Click()

Menu.Show ‘Clicking it leads us back to

EndSub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’the record is edited if it is clicked

Txtvendorcode.SetFocus

End Sub

PrivateSub CmdSave_Click()

Data1.Recordset.Update ’The data is updated or any changes are saved using this button

EndSub

PrivateSub CmdFirst_Click()

Data1.Recordset.MoveFirst

Txtvendorcode.SetFocus

51 | P a g e
EndSub ’we are taken directly to first record

PrivateSub CmdLast_Click()

Data1.Recordset.MoveLast

End Sub ’Here on clicking it we are taken directly to last record

PrivateSub CmdNext_Click()

If Data1.Recordset.EOF Then

Data1.Recordset.MoveFirst ’If it is end of file then we will lead to the first record of the form

Else

Data1.Recordset.MoveNext ’helps in moving to next data

EndIf

EndSub

PrivateSub CmdPrevious_Click()

If Data1.Recordset.BOF Then

Data1.Recordset.MoveFirst

Else ’If then it will move to first record

Data1.Recordset.MovePrevious

EndIf ’We can move to the previous record in form

PrivateSub Txtmobilenum_KeyPress (KeyAscii As Integer)

If (KeyAscii>=48) And (KeyAscii<=57) Or ( KeyAscii = 43 ) Or (KeyAscii = 8 ) Or ( KeyAscii= 127)


Then

Else ’Validation check to allow numbers only

KeyAscii = 0 ’If we press an alphabet we are displayed with an error report asking the user to
only input numbers

MsgBox “Please enter only numbers for the contact number fields" , vbExclamation , "ERROR
REPORT"

EndIf

EndSub

52 | P a g e
PrivateSub Txtphonenum_KeyPress (KeyAscii As Integer)

If (KeyAscii>=48) And (KeyAscii<=57) Or ( KeyAscii = 43 ) Or (KeyAscii = 8 ) Or ( KeyAscii= 127)


Then

Else ’Validation check to allow numbers only

KeyAscii = 0 ’If we press an alphabet we are displayed with an error report asking the user to
only input numbers

MsgBox " Please enter only numbers for the contact number fields" , vbExclamation , "ERROR
REPORT"

EndIf

EndSub

PrivateSub cmdfindId_Click()

Dim criteria As String

vendorcode.Data1.Recordset.FindNext

criteria=""

If

vendorcode.Data1.Recordset.NoMatch = True Then

MsgBox "No match available"

EndIf

EndSub

PrivateSub cmdfindname_Click()

Dim criteria As String

productname.Data1.Recordset.FindNext

53 | P a g e
criteria=""

If productname.Data1.Recordset.NoMatch = True Then

MsgBox "No match available"

EndIf

EndSub

Sale Details Form

‘Following is the code of the table;

Private Sub CmdAdd_Click()

Data1.Recordset.AddNew

Txtsaleid.SetFocus ’Information is added to the Inventory with focus on txtsaleid when clicked

End Sub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’The information in the Data1 sheet can be edited

txtsaleid.SetFocus ’Focus stays on txtsaleid when clicked on the edit button

EndSub

54 | P a g e
PrivateSub CmdDelete_Click()

Dim CmdDelete As Integer

CmdDeletemsg = MsgBox ("Are you sure you want to delete?", vbYesNo + vbExclamation
,"CONFIRMATION MESSAGE") ’The user is asked to confirm the Deletion process

If CmdDeletemsg = 6 Then ’If equal to 6 it means “Yes” for the deletion

Data1.Recordset.Delete

Else ’the the file is deleted

End If

EndSub

PrivateSub Close_Click()

Menu.Show ‘Clicking it leads us back to

EndSub

PrivateSub Sale info_Click()

Sadleinfoform.Show ‘Clicking it leads us to sale info form

EndSub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’the record is edited if it is clicked

Txtsaleid.SetFocus

End Sub

PrivateSub CmdSave_Click()

Data1.Recordset.Update ’The data is updated or any changes are saved using this button

EndSub

PrivateSub CmdFirst_Click()

Data1.Recordset.MoveFirst

Txtsaleid.SetFocus

55 | P a g e
EndSub ’we are taken directly to first record

PrivateSub CmdLast_Click()

Data1.Recordset.MoveLast

End Sub ’Here on clicking it we are taken directly to last record

PrivateSub CmdNext_Click()

If Data1.Recordset.EOF Then

Data1.Recordset.MoveFirst ’If it is end of file then we will lead to the first record of the form

Else

Data1.Recordset.MoveNext ’helps in moving to next data

EndIf

EndSub

PrivateSub CmdPrevious_Click ()

If Data1.Recordset.BOF Then

Data1.Recordset.MoveFirst

Else ’If then it will move to first record

Data1.Recordset.MovePrevious

EndIf ’we can move to the previous record in form

PrivateSub Txtquantitysold_KeyPress (KeyAscii As Integer)

If (KeyAscii>=48) And (KeyAscii<=57) Or ( KeyAscii = 43 ) Or (KeyAscii = 8 ) Or ( KeyAscii= 127)


Then

Else ’Validation check to allow numbers only

KeyAscii = 0 ’If we press an alphabet we are displayed with an error report asking the user to
only input numbers

MsgBox “Please enter only numbers for the quantity in stock field" , vbExclamation , "ERROR
REPORT"

EndIf

EndSub

56 | P a g e
PrivateSub cmdfindId_Click()

Dim criteria As String

vendorcode.Data1.Recordset.FindNext

criteria=""

If

vendorcode.Data1.Recordset.NoMatch = True Then

MsgBox "No match available"

EndIf

EndSub

57 | P a g e
Sale info form

‘Following is the code of the table;

Private Sub CmdAdd_Click()

Data1.Recordset.AddNew

Txtinvoiceitemid.SetFocus ’Information is added to the Inventory with focus on txtinvoiceitemid


when clicked

End Sub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’The information in the Data1 sheet can be edited

txtinviceitemid.SetFocus ’Focus stays on txtinvoiceitemid when clicked on the edit button

EndSub

PrivateSub CmdDelete_Click()

Dim CmdDelete As Integer

CmdDeletemsg = MsgBox ("Are you sure you want to delete?", vbYesNo + vbExclamation
,"CONFIRMATION MESSAGE") ’The user is asked to confirm the Deletion process

If CmdDeletemsg = 6 Then ’If equal to 6 it means “Yes” for the deletion

Data1.Recordset.Delete

58 | P a g e
Else ’the the file is deleted

End If

EndSub

PrivateSub Close_Click()

saleinfoform.hide ‘Clicking it will close the form

EndSub

PrivateSub CmdEdit_Click()

Data1.Recordset.Edit ’the record is edited if it is clicked

Txtinvoiceitemid.SetFocus

End Sub

PrivateSub CmdSave_Click()

Data1.Recordset.Update ’The data is updated or any changes are saved using this button

EndSub

Login Form

‘Login Form Coding'

PrivateSub CmdCancel_Click()

Dim login succeeded As Boolean 'a variable for the Status of login

If login succeeded = False Then

End ’So that the form is closed

59 | P a g e
Dim counter = 1

Else

EndIf

EndSub

PrivateSub CmdOk_Click() ’The button which allow the access to the next form if password is right

If TxtUserName.Text = "username" And ’the original username is not shown

TxtPassword.Text = "Password" Then ’the original password is again not shown

‘NOTE: this is the place from where the password can be changed or set

Menu.Show ’If the password is correct it will lead to the menu

Else

IF counter = 4 then

End ‘ If wrong password is entered 3 times then the program will close itself.

Counter = counter + 1

MsgBox "Invalid Password or UserName ! TryAgain",

vbExclamation , "LOGIN" ’If the password is wrong a message will be displayed asking the user
to renter

TxtPassword.SetFocus ’So that the user can renter the password or username

SendKeys"{Home}+{End}"

EndIf

EndSub

PrivateSub TxtPassword_KeyDown (KeyCode As Integer , Shift As Integer)

If KeyCode = 13 Then

TxtPassword.SetFocus

EndIf

EndSub

PrivateSub TxtUserName_KeyDown(KeyCode As Integer ,Shift As Integer)

60 | P a g e
If KeyCode=13 Then

CmdOk.SetFocus

EndIf

EndSub

Implementation:
This program would be installed onto the
computer using the setup provided. The staff
members would use the program to enter
new data and retrieve the old one. This
program will allow the staff to totally shift from the manual system to this automated one. This new
system will solve all the problems faced by the previous system. Some staff training might be required.
The existing data would have to be converted to work with the new system. Multiple copies of reports
can be made and the performance of the company can be judged by the reports. This program fulfills all
the objectives as listed above at the beginning of this document and also solves all problems faced
previously.

61 | P a g e
Testing:

Plan:
The following test mostly covers all the input masks and functions used in the program. These tests are
to show that the data validation checks work properly and the way they work. Test for other fields are
not shown as they will produce the same results as in the following tests. The program works properly
as visible in the design section of this document. The screen shots show that the forms work properly
too.

If invalid username or password is entered this message is displayed.

Otherwise if both the password and the username are correct the Main menu will be displayed

62 | P a g e
Data entry test:

This test will show how the validation check works if the data type is incorrect
Alphabets are entered in the ‘quantity in stock’ field as you can see in the figure below.
‘Quantity in stock’ should only have numbers in it. This is a type check.

The form will not accept this value and will show an error message.
This message is displayed when wrong type of data is entered.

This is applied to every place where only


numbers should be accepted.

This will be the output for the following


values too.
• 56%^
• Ten

63 | P a g e
If the data entered for a field for example the “quantity in stock field” has an unusually large range then
the following message will be displayed. The error report is evident in the following figures

Or if the data is out of the normal possible range this message is displayed.

64 | P a g e
Test: On pressing the delete Button the expected outcome would be that a confirmation message will be
displayed.

as it can be seen in the following figure that the expected outcome has been obtained.

65 | P a g e
The next test will show how the search works

The number ‘3’ is entered in the code field and the find button is pressed.

The expected outcome would be that the record will be displayed and message boxes will appear which
will say that the record is found.

The record is available so the record is shown and the following message is displayed.

66 | P a g e
The value ‘57’ is entered in the search field for the vendor code

The expected outcome would be that the record will not be shown as it is not present in the database
and an error message will be displayed.

This is evident in the following figure.

The record is not present in the database so the following message is shown to the user.

Note: Tests for other values are not shown as they will show similar results as in the above given
figures. If the data entered has no problems and fulfills all the criteria for the validation checks the data
will be accepted and will be stored without any error message.

67 | P a g e
User Documentation:
The program is very simple and easy to use. As soon as soon as access is granted
to the user through the login a main menu appears. From this menu the user will
be able to access everything needed to run the system. As one of the modules is
opened more options will appear and they let the user open different forms. The
whole system can be navigated through this Menu.

68 | P a g e
Title

New record Delete record


Once a formed is opened it looks like this.

Data fields
Save record

Edit

Generate
Navigational keys report

Search

Everything in the database can be changed using the forms. The form is the best way for data
manipulation.

69 | P a g e
When a report is opened it looks like this:

All the reports and forms have similar formats so the user won’t have any problem with using other
forms or reports.

Title
Sub Titles

Data entries

Date Page no.

70 | P a g e
Blank Page

71 | P a g e

You might also like