Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 95

Database Management System

Strategy and Analysis

Page 1
IT419
Database Management System

Description of current activities

DADA is a shop that is located at Bayanan Muntinlupa City. DADA sells clothes,

shoes, jackets, jeans and accessories. It started as a small business and is now growing

to become hopefully a big and successful clothing store. This clothing company

provides the newest trends and the hippest clothes. I have proposed to build a

database for DADAto be able to help in modernizing and keeping up with the

customers and to show them the latest in my fashion products.

Description of operations

In the year 2007 the two couples cannot handle their shop because they are too

old. So their daughter named Reylinda Gomez start manages their parent’s store.

Reylinda Gomez is an I.T student of Informatics Festival Mall. Reylinda got an idea

to build a database for their shop; she will use a Microsoft Access and Structured

Query Language (SQL) to build her company easy.

Microsoft Access is a program in computer that uses to build a database.

Microsoft Access, is a relational database management system from Microsoft that

combines the relational Microsoft Jet Database Engine with a graphical user interface

and software development tools. It is a member of the Microsoft Office suite of

applications and is included in the Professional and higher versions for Windows and

also sold separately. Access stores data in its own format based on the Access Jet

Database Engine. It can also import or link directly to data stored in other Access

databases, Excel, SharePoint lists, text, XML, Outlook, HTML, dBase, Paradox,

Lotus 1-2-3, or any ODBC-compliant data container including Microsoft SQL Server,

Oracle, MySQL and Postgre SQL. Software developers and data architects can use it

Page 2
IT419
Database Management System

to develop application software and non-programmer "power users" can use it to build

simple applications. Like other Office applications Access is supported by Visual

Basic for Applications, an object-oriented programming language that can reference a

wide variety of objects, including DAO (Data Access Objects) and ActiveX Data

Objects, and many other ActiveX components provided by Microsoft or by third

parties. Visual objects used in forms and reports expose their methods and properties

gracefully in the VBA programming environment, and a huge selection of Windows

operating system functions can be declared and called from VBA code modules,

making Access a rich programming environment.

SQL (Structured Query Language) is a database computer language designed

for managing data in relational database management systems (RDBMS). Its scope

includes data query and update, schema creation and modification, and data access

control. SQL was one of the first languages for Edgar F. Codd’s relational model in

his influential 1970 paper, "A Relational Model of Data for Large Shared Data

Banks" and became the most widely used language for relational databases.

Page 3
IT419
Database Management System

Business Rules and Constraint

I. Business Rules

The company sells clothes in their right process. They can transact to the supplier for

orders, and each customer can have a membership id for their discount. The company

gave their employees much salary for their loyalty.

II. Constraint

# - Primary Key (#) – Foreign Key * - Mandatory o – Optional

Entity Name – Customer

# Customer_ID

(#) Customer_Name

o Address

o Contact_Number

Entity Name – Order

# Order_ID

* Product_ID

* Product_Name

o Quantity

* Customer_ID

Page 4
IT419
Database Management System

Entity Name – Inventory

# Inventory_ID

(#) Inventory_Name

o Units

Entity Name – Category

# Category_ID

(#) Category_Name

* Product_ID

Entity Name – Products

# Product_ID

(#) Product_Name

o Stocks

o Price

* Inventory_ID

Page 5
IT419
Database Management System

Entity Name – Employee

# Employee_ID

(#) First_Name

(#) Last_Name

o Position

o Salary

Page 6
IT419
Database Management System

Entity Relationship and Model Diagram

I. Entity Relationship

# - Primary Key (#) – Foreign Key * - Mandatory o – Optional

Entity Name UID Attributes Entity Description

Category # Category_ID This entity is used


to determine the
(#) Category_Name quality and brand
* of the product.
Product_ID

Customer # Customer_ID This entity


records all the
(#) Customer_Name information about
o Address the customer.

o Contact_Number

Employee # Employee_ID This entity


records all the
(#) First_Name information about
(#) Last_Name the employees.

o Position

o Salary

Page 7
IT419
Database Management System

Entity Name UID Attributes Entity Description

Inventory # Inventory_ID This entity


records all the
(#) Inventory_Name inventory of
o Units products.

Order # Order_ID This entity is used


to records all the
* Product_ID order products of
* Product_Name the customer.

o Quantity

* Customer_ID

Products # Product_ID This entity


records all the
(#) Product_Name products.
o Stocks

o Price

* Inventory_ID

Page 8
IT419
Database Management System

Employee

Employee ID #

First_Name (#)

Last_Name (#)

Postion o

Salary o

Category

Category_ID #

Category_Name (#)

Product_ID *

Customer

Customer_ID #

Customer_Name (#)

Address o

Contact_Number o

Model Diagram

Products
Database Management System

Product_ID #

Product_Name (#)

Stocks o

Price o

Inventory_ID *

Order

Order_ID #

Product_ID *

Product_Name *

Quantity o

Customer_ID *

Inventory

Inventory_ID #

Inventory_Name (#)

Units o
Database Management System

Design
Database Management System

Table Description

Tables Description

Displays the inventory where the


Inventory Table products are located.

Products Table Displays all the products.

Displays all the categories of the


Category products.

Displays the customer’s name, address


Customer Table and contact number.

Order Table Displays ordered product of a customer.

Employee Table Displays the employee’s record.

Inventory Table

Primary Key Field Name Data Type

Pk/Fk Inventory_ID Text

Inventory_Name Text

Units Number
Database Management System

Products Table

Primary Key Field Name Data Type

Pk/Fk Product_ID Text

Inventory_ID Text

Product_Name Text

Stocks Number

Price Currency

Category Table

Primary Key Field Name Data Type

Pk/Fk Category_ID Text

Product_ID Text

Category_Name Text

Customer Table

Primary Key Field Name Data Type

Pk/Fk Customer_ID Text

Customer_Name Text

Address Text

Contact_Number Number
Database Management System

Order Table

Primary Key Field Name Data Type

Pk/Fk Order_ID Text

Product_ID Text

Customer_ID Text

Product_Name Text

Product_Quantity Number

Employee Table

Primary Key Field Name Data Type

Pk/Fk Employee_ID Text

First_Name Text

Last_Name Text

Position Text

Salary Currency
Database Management System

Development
Database Management System

Scripts Listing

User Form

Option Compare Database

Private Sub Command31_Click()

End Sub

Private Sub cmdexit_Click()

On Error GoTo Err_cmdexit_Click

DoCmd.Close

Exit_cmdexit_Click:

Exit Sub

Err_cmdexit_Click:

MsgBox Err.Description
Database Management System

Resume Exit_cmdexit_Click

End Sub

Private Sub cmdlogin_Click()

On Error GoTo Err_cmdlogin_Click

Dim stDocName As String

Dim stLinkCriteria As String

If txtuser = "shad20" And txtpass = "123456" Then

MsgBox "You have successfully logged in!"

DoCmd.Close

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Else

MsgBox "Sorry the username or password is incorrect!"

txtuser = ""

txtpass = ""

txtuser.SetFocus

End If
Database Management System

Exit_cmdlogin_Click:

Exit Sub

Err_cmdlogin_Click:

MsgBox Err.Description

Resume Exit_cmdlogin_Click

End Sub
Database Management System

Main Form

Option Compare Database

Private Sub cmdemp_Click()

On Error GoTo Err_cmdemp_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close

stDocName = "EmployeeForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdemp_Click:

Exit Sub

Err_cmdemp_Click:

MsgBox Err.Description

Resume Exit_cmdemp_Click

End Sub

Private Sub cmdinven_Click()

On Error GoTo Err_cmdinven_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close
Database Management System

stDocName = "InventoryForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdinven_Click:

Exit Sub

Err_cmdinven_Click:

MsgBox Err.Description

Resume Exit_cmdinven_Click

End Sub

Private Sub cmdcategory_Click()

On Error GoTo Err_cmdcategory_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close

stDocName = "CategoryForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdcategory_Click:

Exit Sub

Err_cmdcategory_Click:

MsgBox Err.Description
Database Management System

Resume Exit_cmdcategory_Click

End Sub

Private Sub cmdproduct_Click()

On Error GoTo Err_cmdproduct_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close

stDocName = "ProductForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdproduct_Click:

Exit Sub

Err_cmdproduct_Click:

MsgBox Err.Description

Resume Exit_cmdproduct_Click

End Sub

Private Sub cmdcustomer_Click()

On Error GoTo Err_cmdcustomer_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close
Database Management System

stDocName = "CustomerForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdcustomer_Click:

Exit Sub

Err_cmdcustomer_Click:

MsgBox Err.Description

Resume Exit_cmdcustomer_Click

End Sub

Private Sub cmdorder_Click()

On Error GoTo Err_cmdorder_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close

stDocName = "OrderForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdorder_Click:

Exit Sub

Err_cmdorder_Click:

MsgBox Err.Description
Database Management System

Resume Exit_cmdorder_Click

End Sub

Category Form

Option Compare Database

Private Sub cmdnext_Click()

On Error GoTo Err_cmdnext_Click

DoCmd.GoToRecord , , acNext

Exit_cmdnext_Click:

Exit Sub

Err_cmdnext_Click:

MsgBox Err.Description

Resume Exit_cmdnext_Click

End Sub

Private Sub cmdprev_Click()

On Error GoTo Err_cmdprev_Click

DoCmd.GoToRecord , , acPrevious
Database Management System

Exit_cmdprev_Click:

Exit Sub

Err_cmdprev_Click:

MsgBox Err.Description

Resume Exit_cmdprev_Click

End Sub

Private Sub cmdgtf_Click()

On Error GoTo Err_cmdgtf_Click

DoCmd.GoToRecord , , acFirst

Exit_cmdgtf_Click:

Exit Sub

Err_cmdgtf_Click:

MsgBox Err.Description

Resume Exit_cmdgtf_Click

End Sub

Private Sub cmdgtl_Click()

On Error GoTo Err_cmdgtl_Click

DoCmd.GoToRecord , , acLast
Database Management System

Exit_cmdgtl_Click:

Exit Sub

Err_cmdgtl_Click:

MsgBox Err.Description

Resume Exit_cmdgtl_Click

End Sub

Private Sub cmdfind_Click()

On Error GoTo Err_cmdfind_Click

Screen.PreviousControl.SetFocus

DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdfind_Click:

Exit Sub

Err_cmdfind_Click:

MsgBox Err.Description

Resume Exit_cmdfind_Click

End Sub

Private Sub cmdadd_Click()

On Error GoTo Err_cmdadd_Click


Database Management System

DoCmd.GoToRecord , , acNewRec

Exit_cmdadd_Click:

Exit Sub

Err_cmdadd_Click:

MsgBox Err.Description

Resume Exit_cmdadd_Click

End Sub

Private Sub cmddel_Click()

On Error GoTo Err_cmddel_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmddel_Click:

Exit Sub

Err_cmddel_Click:

MsgBox Err.Description

Resume Exit_cmddel_Click

End Sub

Private Sub cmdsave_Click()


Database Management System

On Error GoTo Err_cmdsave_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_cmdsave_Click:

Exit Sub

Err_cmdsave_Click:

MsgBox Err.Description

Resume Exit_cmdsave_Click

End Sub

Private Sub cmdprint_Click()

On Error GoTo Err_cmdprint_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

DoCmd.PrintOut acSelection

Exit_cmdprint_Click:

Exit Sub

Err_cmdprint_Click:

MsgBox Err.Description

Resume Exit_cmdprint_Click
Database Management System

End Sub

Private Sub cmdundo_Click()

On Error GoTo Err_cmdundo_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Exit_cmdundo_Click:

Exit Sub

Err_cmdundo_Click:

MsgBox Err.Description

Resume Exit_cmdundo_Click

End Sub

Private Sub cmdmain_Click()

On Error GoTo Err_cmdmain_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmain_Click:

Exit Sub
Database Management System

Err_cmdmain_Click:

MsgBox Err.Description

Resume Exit_cmdmain_Click

End Sub

Private Sub cmdexit_Click()

On Error GoTo Err_cmdexit_Click

DoCmd.Close

Exit_cmdexit_Click:

Exit Sub

Err_cmdexit_Click:

MsgBox Err.Description

Resume Exit_cmdexit_Click

End Sub
Database Management System

Customer Form

Option Compare Database

Private Sub cmdnext_Click()

On Error GoTo Err_cmdnext_Click

DoCmd.GoToRecord , , acNext

Exit_cmdnext_Click:

Exit Sub

Err_cmdnext_Click:

MsgBox Err.Description

Resume Exit_cmdnext_Click

End Sub

Private Sub cmdprev_Click()

On Error GoTo Err_cmdprev_Click

DoCmd.GoToRecord , , acPrevious

Exit_cmdprev_Click:

Exit Sub

Err_cmdprev_Click:
Database Management System

MsgBox Err.Description

Resume Exit_cmdprev_Click

End Sub

Private Sub cmdgtf_Click()

On Error GoTo Err_cmdgtf_Click

DoCmd.GoToRecord , , acFirst

Exit_cmdgtf_Click:

Exit Sub

Err_cmdgtf_Click:

MsgBox Err.Description

Resume Exit_cmdgtf_Click

End Sub

Private Sub cmdgtl_Click()

On Error GoTo Err_cmdgtl_Click

DoCmd.GoToRecord , , acLast

Exit_cmdgtl_Click:

Exit Sub
Database Management System

Err_cmdgtl_Click:

MsgBox Err.Description

Resume Exit_cmdgtl_Click

End Sub

Private Sub cmdfind_Click()

On Error GoTo Err_cmdfind_Click

Screen.PreviousControl.SetFocus

DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdfind_Click:

Exit Sub

Err_cmdfind_Click:

MsgBox Err.Description

Resume Exit_cmdfind_Click

End Sub

Private Sub cmdadd_Click()

On Error GoTo Err_cmdadd_Click

DoCmd.GoToRecord , , acNewRec

Exit_cmdadd_Click:
Database Management System

Exit Sub

Err_cmdadd_Click:

MsgBox Err.Description

Resume Exit_cmdadd_Click

End Sub

Private Sub cmddel_Click()

On Error GoTo Err_cmddel_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmddel_Click:

Exit Sub

Err_cmddel_Click:

MsgBox Err.Description

Resume Exit_cmddel_Click

End Sub

Private Sub cmdprint_Click()

On Error GoTo Err_cmdprint_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70


Database Management System

DoCmd.PrintOut acSelection

Exit_cmdprint_Click:

Exit Sub

Err_cmdprint_Click:

MsgBox Err.Description

Resume Exit_cmdprint_Click

End Sub

Private Sub cmdsave_Click()

On Error GoTo Err_cmdsave_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_cmdsave_Click:

Exit Sub

Err_cmdsave_Click:

MsgBox Err.Description

Resume Exit_cmdsave_Click

End Sub

Private Sub cmdundo_Click()

On Error GoTo Err_cmdundo_Click


Database Management System

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Exit_cmdundo_Click:

Exit Sub

Err_cmdundo_Click:

MsgBox Err.Description

Resume Exit_cmdundo_Click

End Sub

Private Sub cmdmain_Click()

On Error GoTo Err_cmdmain_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmain_Click:

Exit Sub

Err_cmdmain_Click:

MsgBox Err.Description

Resume Exit_cmdmain_Click
Database Management System

End Sub

Private Sub cmdexit_Click()

On Error GoTo Err_cmdexit_Click

DoCmd.Close

Exit_cmdexit_Click:

Exit Sub

Err_cmdexit_Click:

MsgBox Err.Description

Resume Exit_cmdexit_Click

End Sub
Database Management System

Employee Form

Option Compare Database

Private Sub cmdnext_Click()

On Error GoTo Err_cmdnext_Click

DoCmd.GoToRecord , , acNext

Exit_cmdnext_Click:

Exit Sub

Err_cmdnext_Click:

MsgBox Err.Description

Resume Exit_cmdnext_Click

End Sub

Private Sub cmdprev_Click()

On Error GoTo Err_cmdprev_Click

DoCmd.GoToRecord , , acPrevious

Exit_cmdprev_Click:

Exit Sub

Err_cmdprev_Click:
Database Management System

MsgBox Err.Description

Resume Exit_cmdprev_Click

End Sub

Private Sub cmdgtf_Click()

On Error GoTo Err_cmdgtf_Click

DoCmd.GoToRecord , , acFirst

Exit_cmdgtf_Click:

Exit Sub

Err_cmdgtf_Click:

MsgBox Err.Description

Resume Exit_cmdgtf_Click

End Sub

Private Sub cmdgtl_Click()

On Error GoTo Err_cmdgtl_Click

DoCmd.GoToRecord , , acLast

Exit_cmdgtl_Click:

Exit Sub
Database Management System

Err_cmdgtl_Click:

MsgBox Err.Description

Resume Exit_cmdgtl_Click

End Sub

Private Sub cmdfind_Click()

On Error GoTo Err_cmdfind_Click

Screen.PreviousControl.SetFocus

DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdfind_Click:

Exit Sub

Err_cmdfind_Click:

MsgBox Err.Description

Resume Exit_cmdfind_Click

End Sub

Private Sub cmdadd_Click()

On Error GoTo Err_cmdadd_Click

DoCmd.GoToRecord , , acNewRec

Exit_cmdadd_Click:
Database Management System

Exit Sub

Err_cmdadd_Click:

MsgBox Err.Description

Resume Exit_cmdadd_Click

End Sub

Private Sub cmddel_Click()

On Error GoTo Err_cmddel_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmddel_Click:

Exit Sub

Err_cmddel_Click:

MsgBox Err.Description

Resume Exit_cmddel_Click

End Sub

Private Sub cmdprint_Click()

On Error GoTo Err_cmdprint_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70


Database Management System

DoCmd.PrintOut acSelection

Exit_cmdprint_Click:

Exit Sub

Err_cmdprint_Click:

MsgBox Err.Description

Resume Exit_cmdprint_Click

End Sub

Private Sub cmdsave_Click()

On Error GoTo Err_cmdsave_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_cmdsave_Click:

Exit Sub

Err_cmdsave_Click:

MsgBox Err.Description

Resume Exit_cmdsave_Click

End Sub

Private Sub cmdundo_Click()

On Error GoTo Err_cmdundo_Click


Database Management System

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Exit_cmdundo_Click:

Exit Sub

Err_cmdundo_Click:

MsgBox Err.Description

Resume Exit_cmdundo_Click

End Sub

Private Sub cmdmain_Click()

On Error GoTo Err_cmdmain_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmain_Click:

Exit Sub

Err_cmdmain_Click:

MsgBox Err.Description

Resume Exit_cmdmain_Click
Database Management System

End Sub

Private Sub cmdexit_Click()

On Error GoTo Err_cmdexit_Click

DoCmd.Close

Exit_cmdexit_Click:

Exit Sub

Err_cmdexit_Click:

MsgBox Err.Description

Resume Exit_cmdexit_Click

End Sub
Database Management System

Inventory Form

Option Compare Database

Private Sub cmdnext_Click()

On Error GoTo Err_cmdnext_Click

DoCmd.GoToRecord , , acNext

Exit_cmdnext_Click:

Exit Sub

Err_cmdnext_Click:

MsgBox Err.Description

Resume Exit_cmdnext_Click

End Sub

Private Sub cmdprev_Click()

On Error GoTo Err_cmdprev_Click

DoCmd.GoToRecord , , acPrevious

Exit_cmdprev_Click:

Exit Sub
Database Management System

Err_cmdprev_Click:

MsgBox Err.Description

Resume Exit_cmdprev_Click

End Sub

Private Sub cmdgtf_Click()

On Error GoTo Err_cmdgtf_Click

DoCmd.GoToRecord , , acFirst

Exit_cmdgtf_Click:

Exit Sub

Err_cmdgtf_Click:

MsgBox Err.Description

Resume Exit_cmdgtf_Click

End Sub

Private Sub cmdgtl_Click()

On Error GoTo Err_cmdgtl_Click

DoCmd.GoToRecord , , acLast

Exit_cmdgtl_Click:

Exit Sub
Database Management System

Err_cmdgtl_Click:

MsgBox Err.Description

Resume Exit_cmdgtl_Click

End Sub

Private Sub cmdfind_Click()

On Error GoTo Err_cmdfind_Click

Screen.PreviousControl.SetFocus

DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdfind_Click:

Exit Sub

Err_cmdfind_Click:

MsgBox Err.Description

Resume Exit_cmdfind_Click

End Sub

Private Sub cmdadd_Click()

On Error GoTo Err_cmdadd_Click

DoCmd.GoToRecord , , acNewRec
Database Management System

Exit_cmdadd_Click:

Exit Sub

Err_cmdadd_Click:

MsgBox Err.Description

Resume Exit_cmdadd_Click

End Sub

Private Sub cmddel_Click()

On Error GoTo Err_cmddel_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmddel_Click:

Exit Sub

Err_cmddel_Click:

MsgBox Err.Description

Resume Exit_cmddel_Click

End Sub

Private Sub cmdprint_Click()

On Error GoTo Err_cmdprint_Click


Database Management System

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

DoCmd.PrintOut acSelection

Exit_cmdprint_Click:

Exit Sub

Err_cmdprint_Click:

MsgBox Err.Description

Resume Exit_cmdprint_Click

End Sub

Private Sub cmdsave_Click()

On Error GoTo Err_cmdsave_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_cmdsave_Click:

Exit Sub

Err_cmdsave_Click:

MsgBox Err.Description

Resume Exit_cmdsave_Click

End Sub

Private Sub cmdundo_Click()

On Error GoTo Err_cmdundo_Click


Database Management System

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Exit_cmdundo_Click:

Exit Sub

Err_cmdundo_Click:

MsgBox Err.Description

Resume Exit_cmdundo_Click

End Sub

Private Sub cmdmain_Click()

On Error GoTo Err_cmdmain_Click

Dim stDocName As String

Dim stLinkCriteria As String

DoCmd.Close

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmain_Click:

Exit Sub

Err_cmdmain_Click:

MsgBox Err.Description
Database Management System

Resume Exit_cmdmain_Click

End Sub

Private Sub cmdexit_Click()

On Error GoTo Err_cmdexit_Click

DoCmd.Close

Exit_cmdexit_Click:

Exit Sub

Err_cmdexit_Click:

MsgBox Err.Description

Resume Exit_cmdexit_Click

End Sub
Database Management System

Order Form

Option Compare Database

Private Sub cmdnext_Click()

On Error GoTo Err_cmdnext_Click

DoCmd.GoToRecord , , acNext

Exit_cmdnext_Click:

Exit Sub

Err_cmdnext_Click:

MsgBox Err.Description

Resume Exit_cmdnext_Click

End Sub

Private Sub cmdprev_Click()

On Error GoTo Err_cmdprev_Click

DoCmd.GoToRecord , , acPrevious

Exit_cmdprev_Click:

Exit Sub

Err_cmdprev_Click:
Database Management System

MsgBox Err.Description

Resume Exit_cmdprev_Click

End Sub

Private Sub cmdgtf_Click()

On Error GoTo Err_cmdgtf_Click

DoCmd.GoToRecord , , acFirst

Exit_cmdgtf_Click:

Exit Sub

Err_cmdgtf_Click:

MsgBox Err.Description

Resume Exit_cmdgtf_Click

End Sub

Private Sub cmdgtl_Click()

On Error GoTo Err_cmdgtl_Click

DoCmd.GoToRecord , , acLast

Exit_cmdgtl_Click:

Exit Sub
Database Management System

Err_cmdgtl_Click:

MsgBox Err.Description

Resume Exit_cmdgtl_Click

End Sub

Private Sub cmdfind_Click()

On Error GoTo Err_cmdfind_Click

Screen.PreviousControl.SetFocus

DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdfind_Click:

Exit Sub

Err_cmdfind_Click:

MsgBox Err.Description

Resume Exit_cmdfind_Click

End Sub

Private Sub cmdadd_Click()

On Error GoTo Err_cmdadd_Click

DoCmd.GoToRecord , , acNewRec

Exit_cmdadd_Click:
Database Management System

Exit Sub

Err_cmdadd_Click:

MsgBox Err.Description

Resume Exit_cmdadd_Click

End Sub

Private Sub cmddel_Click()

On Error GoTo Err_cmddel_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmddel_Click:

Exit Sub

Err_cmddel_Click:

MsgBox Err.Description

Resume Exit_cmddel_Click

End Sub

Private Sub cmdprint_Click()

On Error GoTo Err_cmdprint_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70


Database Management System

DoCmd.PrintOut acSelection

Exit_cmdprint_Click:

Exit Sub

Err_cmdprint_Click:

MsgBox Err.Description

Resume Exit_cmdprint_Click

End Sub

Private Sub cmdsave_Click()

On Error GoTo Err_cmdsave_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_cmdsave_Click:

Exit Sub

Err_cmdsave_Click:

MsgBox Err.Description

Resume Exit_cmdsave_Click

End Sub

Private Sub cmdundo_Click()

On Error GoTo Err_cmdundo_Click


Database Management System

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Exit_cmdundo_Click:

Exit Sub

Err_cmdundo_Click:

MsgBox Err.Description

Resume Exit_cmdundo_Click

End Sub

Private Sub cmdmain_Click()

On Error GoTo Err_cmdmain_Click

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmain_Click:

Exit Sub

Err_cmdmain_Click:

MsgBox Err.Description

Resume Exit_cmdmain_Click
Database Management System

End Sub

Private Sub cmdexit_Click()

On Error GoTo Err_cmdexit_Click

DoCmd.Close

Exit_cmdexit_Click:

Exit Sub

Err_cmdexit_Click:

MsgBox Err.Description

Resume Exit_cmdexit_Click

End Sub

Private Sub cmdmainb_Click()

On Error GoTo Err_cmdmainb_Click

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmainb_Click:

Exit Sub
Database Management System

Err_cmdmainb_Click:

MsgBox Err.Description

Resume Exit_cmdmainb_Click

End Sub

Private Sub Command28_Click()

On Error GoTo Err_Command28_Click

DoCmd.Close

Exit_Command28_Click:

Exit Sub

Err_Command28_Click:

MsgBox Err.Description

Resume Exit_Command28_Click

End Sub
Database Management System

Product Form

Option Compare Database

Private Sub cmdnext_Click()

On Error GoTo Err_cmdnext_Click

DoCmd.GoToRecord , , acNext

Exit_cmdnext_Click:

Exit Sub

Err_cmdnext_Click:

MsgBox Err.Description

Resume Exit_cmdnext_Click

End Sub

Private Sub cmdprev_Click()

On Error GoTo Err_cmdprev_Click

DoCmd.GoToRecord , , acPrevious

Exit_cmdprev_Click:

Exit Sub

Err_cmdprev_Click:
Database Management System

MsgBox Err.Description

Resume Exit_cmdprev_Click

End Sub

Private Sub cmdgtf_Click()

On Error GoTo Err_cmdgtf_Click

DoCmd.GoToRecord , , acFirst

Exit_cmdgtf_Click:

Exit Sub

Err_cmdgtf_Click:

MsgBox Err.Description

Resume Exit_cmdgtf_Click

End Sub

Private Sub cmdgtl_Click()

On Error GoTo Err_cmdgtl_Click

DoCmd.GoToRecord , , acLast

Exit_cmdgtl_Click:

Exit Sub
Database Management System

Err_cmdgtl_Click:

MsgBox Err.Description

Resume Exit_cmdgtl_Click

End Sub

Private Sub cmdfind_Click()

On Error GoTo Err_cmdfind_Click

Screen.PreviousControl.SetFocus

DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdfind_Click:

Exit Sub

Err_cmdfind_Click:

MsgBox Err.Description

Resume Exit_cmdfind_Click

End Sub

Private Sub cmdadd_Click()

On Error GoTo Err_cmdadd_Click

DoCmd.GoToRecord , , acNewRec

Exit_cmdadd_Click:
Database Management System

Exit Sub

Err_cmdadd_Click:

MsgBox Err.Description

Resume Exit_cmdadd_Click

End Sub

Private Sub cmddel_Click()

On Error GoTo Err_cmddel_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmddel_Click:

Exit Sub

Err_cmddel_Click:

MsgBox Err.Description

Resume Exit_cmddel_Click

End Sub

Private Sub cmdprint_Click()

On Error GoTo Err_cmdprint_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70


Database Management System

DoCmd.PrintOut acSelection

Exit_cmdprint_Click:

Exit Sub

Err_cmdprint_Click:

MsgBox Err.Description

Resume Exit_cmdprint_Click

End Sub

Private Sub cmdsave_Click()

On Error GoTo Err_cmdsave_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_cmdsave_Click:

Exit Sub

Err_cmdsave_Click:

MsgBox Err.Description

Resume Exit_cmdsave_Click

End Sub

Private Sub cmdundo_Click()

On Error GoTo Err_cmdundo_Click


Database Management System

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Exit_cmdundo_Click:

Exit Sub

Err_cmdundo_Click:

MsgBox Err.Description

Resume Exit_cmdundo_Click

End Sub

Private Sub cmdmain_Click()

On Error GoTo Err_cmdmain_Click

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmain_Click:

Exit Sub

Err_cmdmain_Click:

MsgBox Err.Description

Resume Exit_cmdmain_Click
Database Management System

End Sub

Private Sub cmdexit_Click()

On Error GoTo Err_cmdexit_Click

DoCmd.Close

Exit_cmdexit_Click:

Exit Sub

Err_cmdexit_Click:

MsgBox Err.Description

Resume Exit_cmdexit_Click

End Sub

Private Sub cmdmainb_Click()

On Error GoTo Err_cmdmainb_Click

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "MainForm"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmainb_Click:

Exit Sub
Database Management System

Err_cmdmainb_Click:

MsgBox Err.Description

Resume Exit_cmdmainb_Click

End Sub

Private Sub Command28_Click()

On Error GoTo Err_Command28_Click

DoCmd.Close

Exit_Command28_Click:

Exit Sub

Err_Command28_Click:

MsgBox Err.Description

Resume Exit_Command28_Click

End Sub
Database Management System

Testing

I. Test Plan

Test Case Objectives


1 To test if the tables are
created properly.
2 To test if the values are
inserted properly
3 To test the relationship of the
tables using the foreign key
and primary key

4 To test if the LOG IN button


will work successfully.

5 To test if the CLOSE button


will work.
6 To test if NEXT button will
work properly.
7 To test if the PREVIOUS
button will work properly
8 To test if the GO TO FIRST
button will work properly
9 To test if the GO TO LAST
form will work properly.
10 To test if the FIND button
will find a record on the
form.
11 To test if the ADD button
will add another record.
12 To test if the DELETE
button will delete a record.
13 To test if the SAVE button
will save the data.
14 To test if the UNDO button
will undo the last action.
15 To test if the MAIN button
will go to MAIN FORM.
Database Management System

II. Test Cases

Test Case 1
Objective To test if the tables are created properly.
Test Data CREATE TABLE Inventory
(
Inventory_ID Text,
Inventory_Name Text,
Units Number,

CONSTRAINT Inventory_Inventory_ID_pk primary


key(Inventory_ID)
);
Expected The table, fieldnames, primary key will be created
Test Result
Actual Test
Result

Test Case 2
Objective To test if the values are inserted properly
Test Data INSERT INTO Inventory ( Inventory_ID, Inventory_Name, Units )
VALUES ('INV01', 'Clothes', 25);

Expected The table with records will be created


Test Result
Actual Test
Result
Database Management System

Test Case 3
Objective To test the relationship of the tables using the foreign key and primary
key
Test Data ALTER TABLE Products
ADD CONSTRAINT Products_Inventory_ID_fk foreign
key(Inventory_ID)
REFERENCES Inventory(Inventory_ID);

Expected The tables will have a relationship


Test Result
Actual Test
Result
Database Management System

Test Case 4
Objective To test if the LOG IN button will work successfully.
Test Data Private Sub cmdlogin_Click()
On Error GoTo Err_cmdlogin_Click

Dim stDocName As String


Dim stLinkCriteria As String
If txtuser = "shad20" And txtpass = "123456" Then
MsgBox "You have successfully logged in!"
DoCmd.Close
stDocName = "MainForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Sorry the username or password is incorrect!"
txtuser = ""
txtpass = ""
txtuser.SetFocus
End If

Exit_cmdlogin_Click:
Exit Sub

Err_cmdlogin_Click:
MsgBox Err.Description
Resume Exit_cmdlogin_Click

End Sub
Expected The log in button will work successfully.
Test Result
Actual Test
Result
Database Management System

Test Case 5
Objective To test if the CLOSE button will work.
Test Data Private Sub cmdexit_Click()
On Error GoTo Err_cmdexit_Click

DoCmd.Close

Exit_cmdexit_Click:
Exit Sub

Err_cmdexit_Click:
MsgBox Err.Description
Resume Exit_cmdexit_Click

End Sub
Expected The close button will work successfully.
Test Result
Actual Test
Result
Database Management System

Test Case 6
Objective To test if NEXT button will work properly.
Test Data Private Sub cmdnext_Click()
On Error GoTo Err_cmdnext_Click

DoCmd.GoToRecord , , acNext

Exit_cmdnext_Click:
Exit Sub

Err_cmdnext_Click:
MsgBox Err.Description
Resume Exit_cmdnext_Click

End Sub
Expected The next button will show the next record
Test Result
Actual Test
Result
Database Management System

Test Case 7
Objective To test if the PREVIOUS button will work properly
Test Data Private Sub cmdprev_Click()
On Error GoTo Err_cmdprev_Click

DoCmd.GoToRecord , , acPrevious

Exit_cmdprev_Click:
Exit Sub

Err_cmdprev_Click:
MsgBox Err.Description
Resume Exit_cmdprev_Click

End Sub
Expected The previous button will show the previous record
Test Result
Actual Test
Result
Database Management System

Test Case 8
Objective To test if the GO TO FIRST button will work properly
Test Data Private Sub cmdgtf_Click()
On Error GoTo Err_cmdgtf_Click

DoCmd.GoToRecord , , acFirst

Exit_cmdgtf_Click:
Exit Sub

Err_cmdgtf_Click:
MsgBox Err.Description
Resume Exit_cmdgtf_Click

End Sub
Expected The go to first button will show the first record
Test Result
Actual Test
Result
Database Management System

Test Case 9
Objective To test if the GO TO LAST form will work properly.
Test Data Private Sub cmdgtl_Click()
On Error GoTo Err_cmdgtl_Click

DoCmd.GoToRecord , , acLast

Exit_cmdgtl_Click:
Exit Sub

Err_cmdgtl_Click:
MsgBox Err.Description
Resume Exit_cmdgtl_Click

End Sub
Expected The go to last button will show the last record
Test Result
Actual Test
Result
Database Management System

Test Case 10
Objective To test if the FIND button will find a record on the form.
Test Data Private Sub cmdfind_Click()
On Error GoTo Err_cmdfind_Click

Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_cmdfind_Click:
Exit Sub

Err_cmdfind_Click:
MsgBox Err.Description
Resume Exit_cmdfind_Click

End Sub
Expected The find button will find a record
Test Result
Actual Test
Result
Database Management System

Test Case 11
Objective To test if the ADD button will add another record.
Test Data Private Sub cmdadd_Click()
On Error GoTo Err_cmdadd_Click

DoCmd.GoToRecord , , acNewRec

Exit_cmdadd_Click:
Exit Sub

Err_cmdadd_Click:
MsgBox Err.Description
Resume Exit_cmdadd_Click

End Sub
Expected The add button will add a record
Test Result
Actual Test
Result
Database Management System

Test Case 12
Objective To test if the DELETE button will delete a record.
Test Data Private Sub cmddel_Click()
On Error GoTo Err_cmddel_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70


DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmddel_Click:
Exit Sub

Err_cmddel_Click:
MsgBox Err.Description
Resume Exit_cmddel_Click

End Sub
Expected The delete button will delete a record
Test Result
Actual Test
Result
Database Management System

Test Case 13
Objective To test if the SAVE button will save the data.
Test Data Private Sub cmdsave_Click()
On Error GoTo Err_cmdsave_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,


acMenuVer70

Exit_cmdsave_Click:
Exit Sub

Err_cmdsave_Click:
MsgBox Err.Description
Resume Exit_cmdsave_Click

End Sub
Expected The save button will save the record
Test Result
Actual Test
Result
Database Management System

Test Case 14
Objective To test if the UNDO button will undo the last action.
Test Data Private Sub cmdundo_Click()
On Error GoTo Err_cmdundo_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, ,


acMenuVer70

Exit_cmdundo_Click:
Exit Sub

Err_cmdundo_Click:
MsgBox Err.Description
Resume Exit_cmdundo_Click

End Sub
Expected The undo button will undo the last action
Test Result
Actual Test
Result
Database Management System

Test Case 15
Objective To test if the MAIN button will go to MAIN FORM.
Test Data Private Sub cmdmain_Click()
On Error GoTo Err_cmdmain_Click

Dim stDocName As String


Dim stLinkCriteria As String
DoCmd.Close

stDocName = "MainForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdmain_Click:
Exit Sub

Err_cmdmain_Click:
MsgBox Err.Description
Resume Exit_cmdmain_Click

End Sub
Expected The main button show the main form
Test Result
Actual Test
Result
Database Management System

III. Test Log

Test Case Status


1 Success
2 Success
3 Success
4 Success
5 Success
6 Success
7 Success
8 Success
9 Success
10 Success
11 Success
12 Success
13 Success
14 Success
15 Successl
Database Management System

Implementation
Database Management System

User Manual

a.) Click Microsoft Access 2003


Database Management System

Step 2 This is the time that you will create your New Database

a.) Click New


Database Management System

b.) Click Blank database


Database Management System

Step 3 This is the time to save your database

a.) Select the destination folder you want to save your file.

b.) Click Create


Database Management System

Step 4 You will design your Database

a.) Click Queries


Database Management System

b.) Double Click Create query in design view


Database Management System

c.) Click Close


Database Management System

d.) Click SQL


Database Management System

Step 5 This the time to type your code

Type your code in the box.


Database Management System

Step 6 Since you have tables this time you should create a form.

Creating Forms

1. Click Forms
2. Click Create form in Design View

3. Since you have the form. This is the time that you will design your form.
Database Management System

4. To change the format of your form:


a. Right click on your form then click Properties

5. If you are finished designing and formatting your form.

Save your form.


Database Management System

REFERENCES

IT 419 Project Guidelines

Previous Projects

You might also like