final project hadi complete
TRANSCRIPT
-
8/7/2019 Final project Hadi complete
1/71
1 | P a g e
General Certificate of EducationAdvanced LevelCOMPUTINGFor 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 ContentsAnalysis: ........................................................................................................................................................ 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
-
8/7/2019 Final project Hadi complete
2/71
2 | P a g e
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 differentregisters for data input. They include Inventory information register, Product information register,Vendor information register, Invoice information register and sale information register. These registershave all the information to control the database system. All the changes in this system have to be mademanually. The manual system they have is very difficult to handle and to work on. It is not very efficientand cannot fulfill the requirements needed for this growing company. The new inventory control systemdeveloped is an automated one. It will meet all requirements for their company and will greatly improvethe 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 theinventory
To store data
The new system will solve all the problems faced in the previous system and even furtherimprove the system. Another solution can be that the computers can be networked and datacan be shared between the pos terminal and the stock control system. This will further help inthe 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..
-
8/7/2019 Final project Hadi complete
3/71
3 | P a g e
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
-
8/7/2019 Final project Hadi complete
4/71
4 | P a g e
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
-
8/7/2019 Final project Hadi complete
5/71
5 | P a g e
Emails
How the data will be collected and used:This data will be collected from different places. For example for vendors data their cards will be usedto enter data about them. The sale related information will be collected from the counter etc. Theproduct 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 thestaff 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, rangecheck, null check and etc. Users will be able to search through different records using the search enginespresent in the program itself. Different queries will help to search for different records. Sorting isautomatically done by the program when the user opens the tables. The user can also change thesorting criteria
The output from the program would be in the form of reports and forms. The forms and reports can beprinted. The reports will help show the performance of the store. It will show the trend for sales. Thedemand of the customers could be judged by the amount of products sold. The inventory could bechecked and new orders could be made by using the data. Forms could be used to print information ona specific record such as an item or a vendor .As for the security and backups a separate computersystem will e setup to keep information of older records and backups. Passwords will allow only theauthorized staff to use the program.
-
8/7/2019 Final project Hadi complete
6/71
6 | P a g e
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 thismuch 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 cant 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.
-
8/7/2019 Final project Hadi complete
7/71
7 | P a g e
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.
-
8/7/2019 Final project Hadi complete
8/71
8 | P a g e
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 cant 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 canbe easily removed)
Backup utility (If the data is lost or stolen then in this case backup must bepresent to overcome any upcoming trouble)
Recovery Utility (If the data or program is corrupted then there must besoftware to recover it)
File compression (This is a technique to reduce the space occupied by anyprogram or document)
File defragmentation (If the data get scattered then this is useful to reorderthe data)
The hardware listed above would be required to run this program.
-
8/7/2019 Final project Hadi complete
9/71
9 | P a g e
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 interfaceand coding for the database. It has great options for making new tables, forms, reports. It has a veryfriendly user interface. And using this software there are great possibilities of generating databasesystems. A virtual wizard present in this software helps to make new forms, tables etc. buttons can bemade on the on screen forms. Menus can be made for the database system using the switchboardmanager 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 andvery much versatile. It was planed that it be made in such a way that the user could start using theprogram with little or no training. The design to be kept simple but at the same time providing greatpower and accessibility in handling the data. The program was planed in such a way that it would notonly solve the problems faced in the earlier system but also provide new features which would helpeven more with
-
8/7/2019 Final project Hadi complete
10/71
10 | P a g e
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
-
8/7/2019 Final project Hadi complete
11/71
11 | 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
-
8/7/2019 Final project Hadi complete
12/71
12 | 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 thetables are shown with some sample data in it.
-
8/7/2019 Final project Hadi complete
13/71
13 | P a g e
Inventory information table:
Product information table:
Recipe information table:
Continued on next page..
-
8/7/2019 Final project Hadi complete
14/71
14 | P a g e
Invoice and Invoice item Information tables:
Sale details and Sale information tables:
Vendor Information table:
-
8/7/2019 Final project Hadi complete
15/71
15 | P a g e
In this database system data entry is easier. Forms not only help to enter new data and records but youcan also retrieve, edit and make print outs of the data. The following screen shot shows the list of formsmade.
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. printthem or even search for record. The navigational keys below help to go through different records. Thedesign is kept simple so it can be more users friendly. The operational keys have been grouped in oneplace and vivid colours are used for headings and titles so they can be easily understood.
-
8/7/2019 Final project Hadi complete
16/71
16 | P a g e
This is the Invoice info form it has another feature in it. Related record can be directly opened throughthe form. When the invoice item info button is pressed the record is retrieved which has the same Idand are related to each other. This form also has a check box for easy usage. Al the forms designs arekept similar to each other so that there wont be any difficulty in using them.
-
8/7/2019 Final project Hadi complete
17/71
17 | P a g e
Other forms include:
Vendor information form:
Sale Info Form
-
8/7/2019 Final project Hadi complete
18/71
18 | P a g e
Another interesting feature of the database system is the Switchboard it launches it self as soon as theprogram has been run. It is a kind of menu, it greatly helps in navigating through the whole data basesystem.
This menu runs as soon as the program is launched. From here you can open anything that is in thedatabase. This is the easiest way to navigate through the database.
-
8/7/2019 Final project Hadi complete
19/71
19 | P a g e
In this database system you can also generate reports. Reports show all the data stored in a table in anorderly manner.
These are some of the reports that can be generated. The following screen shot shows a generatedreport.
The report shown in this screen shot shows all the records in the vendor information table.
Continued on next page
-
8/7/2019 Final project Hadi complete
20/71
20 | 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. Printouts can be taken of these reports.
-
8/7/2019 Final project Hadi complete
21/71
21 | 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
ValidationError Report
Sorting
Sorted data
Validated data
Updating
Old master file
New master file
Forms anddata in logical
order
Reports
-
8/7/2019 Final project Hadi complete
22/71
22 | 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 techniqueswere 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 usedwhere only numbers are required.
3. Selection:The user has been given the ability to select through different options for example in the main menu orin 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 passwordrepeatedly. 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 thatfollow.
7. Searching:The option for searching for records is also been
-
8/7/2019 Final project Hadi complete
23/71
23 | P a g e
Algorithms of the following tasks
-
8/7/2019 Final project Hadi complete
24/71
24 | P a g e
-
8/7/2019 Final project Hadi complete
25/71
25 | P a g e
-
8/7/2019 Final project Hadi complete
26/71
26 | P a g e
The new inventory control system developed is an automated one. It includes different tables such asInventory item info table, Invoice info table and etcetera as shown in the picture.
-
8/7/2019 Final project Hadi complete
27/71
-
8/7/2019 Final project Hadi complete
28/71
28 | P a g e
The tables used in the database
-
8/7/2019 Final project Hadi complete
29/71
29 | P a g e
-
8/7/2019 Final project Hadi complete
30/71
30 | P a g e
The fig: 1.0 shows all the tables used in the database system. These tables include different entities. Thetables are linked together with each other through these entities and they form relationships. All therelationships 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 inthe inventory.
It is changed because of two processes, one if a product is sold the items in the inventory get used upand second if new items come into the inventory from the vendors.
-
8/7/2019 Final project Hadi complete
31/71
31 | P a g e
In the processes of selling the product, the recipe info table shows the item and the amount used in theproduct to be made.
The information about the product is given in the product info table it gives the details about theproduct.
The sold products information goes to the Sale details table. The sale info table and the sale detail tablesare 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 infotable to give details of the sale.
This is how the item info table if
affected by the sales.
-
8/7/2019 Final project Hadi complete
32/71
32 | P a g e
The second process by which the main table, the item info table is affected is by the income of newitems from different vendors. The information of the new items is divided onto two tables the Invoiceinfo 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 isa vendor info table which holds the records of all the vendors of the items. The picture that followsshows the vendor info table.
It holds all the information about the vendor including there contact numbers and there ids.
Continued on next page
-
8/7/2019 Final project Hadi complete
33/71
33 | P a g e
In manual database systems there are chances that the data being input mite be wrong so in thisdatabase system there are some validation checks at the time of data input. The following screen shotswill show some of the input masks applied on various tables.
Another input used would be
These input masks help in validating the data.
-
8/7/2019 Final project Hadi complete
34/71
34 | 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
-
8/7/2019 Final project Hadi complete
35/71
35 | 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
-
8/7/2019 Final project Hadi complete
36/71
36 | 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
-
8/7/2019 Final project Hadi complete
37/71
37 | 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
-
8/7/2019 Final project Hadi complete
38/71
38 | 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 whenclicked
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
-
8/7/2019 Final project Hadi complete
39/71
39 | 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
-
8/7/2019 Final project Hadi complete
40/71
40 | 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
-
8/7/2019 Final project Hadi complete
41/71
41 | 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
-
8/7/2019 Final project Hadi complete
42/71
42 | 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 ontxtinvoiceitemid 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
-
8/7/2019 Final project Hadi complete
43/71
43 | 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
-
8/7/2019 Final project Hadi complete
44/71
44 | 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 whenclicked
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
-
8/7/2019 Final project Hadi complete
45/71
45 | 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
-
8/7/2019 Final project Hadi complete
46/71
46 | 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
-
8/7/2019 Final project Hadi complete
47/71
47 | 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
-
8/7/2019 Final project Hadi complete
48/71
48 | 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 txtinvoiceitemidwhen 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
-
8/7/2019 Final project Hadi complete
49/71
49 | 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
-
8/7/2019 Final project Hadi complete
50/71
50 | 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 txtvendorcodewhen clicked
End Sub
PrivateSub CmdEdit_Click()
Data1.Recordset.Edit The information in the Data1 sheet can be edited
-
8/7/2019 Final project Hadi complete
51/71
51 | 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
-
8/7/2019 Final project Hadi complete
52/71
52 | 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
-
8/7/2019 Final project Hadi complete
53/71
53 | P a g e
PrivateSub Txtphonenum_KeyPress (KeyAscii As Integer)
If (KeyAscii>=48) And (KeyAscii
-
8/7/2019 Final project Hadi complete
54/71
54 | 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
-
8/7/2019 Final project Hadi complete
55/71
55 | 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
-
8/7/2019 Final project Hadi complete
56/71
56 | 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
-
8/7/2019 Final project Hadi complete
57/71
57 | 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
-
8/7/2019 Final project Hadi complete
58/71
-
8/7/2019 Final project Hadi complete
59/71
59 | 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
-
8/7/2019 Final project Hadi complete
60/71
60 | 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 userto 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)
-
8/7/2019 Final project Hadi complete
61/71
61 | P a g e
If KeyCode=13 Then
CmdOk.SetFocus
EndIf
EndSub
Implementation:This program would be installed onto thecomputer using the setup provided. The staff members would use the program to enternew data and retrieve the old one. Thisprogram 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 reportscan be made and the performance of the company can be judged by the reports. This program fulfills allthe objectives as listed above at the beginning of this document and also solves all problems facedpreviously.
-
8/7/2019 Final project Hadi complete
62/71
62 | P a g e
Testing:
Plan:The following test mostly covers all the input masks and functions used in the program. These tests areto show that the data validation checks work properly and the way they work. Test for other fields arenot shown as they will produce the same results as in the following tests. The program works properlyas visible in the design section of this document. The screen shots show that the forms work properlytoo.
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
-
8/7/2019 Final project Hadi complete
63/71
63 | P a g e
Data entry test:
This test will show how the validation check works if the data type is incorrectAlphabets 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 onlynumbers should be accepted.
This will be the output for the followingvalues too.
56%^ Ten
-
8/7/2019 Final project Hadi complete
64/71
64 | P a g e
If the data entered for a field for example the quantity in stock field has an unusually large range thenthe 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.
-
8/7/2019 Final project Hadi complete
65/71
65 | P a g e
Test: On pressing the delete Button the expected outcome would be that a confirmation message will bedisplayed.
as it can be seen in the following figure that the expected outcome has been obtained.
-
8/7/2019 Final project Hadi complete
66/71
66 | 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 whichwill say that the record is found.
The record is available so the record is shown and the following message is displayed.
-
8/7/2019 Final project Hadi complete
67/71
67 | 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 databaseand 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 givenfigures. If the data entered has no problems and fulfills all the criteria for the validation checks the datawill be accepted and will be stored without any error message.
-
8/7/2019 Final project Hadi complete
68/71
68 | P a g e
User Documentation:The program is very simple and easy to use. As soon as soon as access is grantedto the user through the login a main menu appears. From this menu the user willbe able to access everything needed to run the system. As one of the modules isopened more options will appear and they let the user open different forms. Thewhole system can be navigated through this Menu.
-
8/7/2019 Final project Hadi complete
69/71
69 | P a g e
Once a formed is opened it looks like this.
Everything in the database can be changed using the forms. The form is the best way for datamanipulation.
Title
New record Delete rec
Save rec
Edit
GeneratereportNavigational keys
Search
Data fields
-
8/7/2019 Final project Hadi complete
70/71
70 | P a g e
When a report is opened it looks like this:
All the reports and forms have similar formats so the user wont have any problem with using otherforms or reports.
TitleSub Titles
Data entries
Date Page no.
-
8/7/2019 Final project Hadi complete
71/71
Blank Page