Bookstore Management System
Bookstore Management System
Table of Contents
Table of Figures 2
I. Introduction to the database application system 3
II. System analysis 5
1. Investigation of the business: 5
2. Entity Relationship Diagram (ERD): 5
III. System design 7
1. Data Structure Diagram (DSD): 7
2. Database Modeling: 9
3. Database Design: Design Form and Report 10
IV. System implementation 11
1. Table creation: 11
2. Form creation: 14
3. Query creation 20
4. Report creation: 26
V. User instruction 29
1. Open and Close the Bookstore Management System: 29
2. Input data into the database: 30
3. Retrieve data from the database: 34
References 36
Work assignment and peer assignment 38
PAGE
\*
MERG
MAT 2
Table of Figures
Figure 1 Entity Relationship Diagram 5
Figure 2 Data Structure Diagram 8
Figure 3 tblAuthor in Datasheet View 9
Figure 4 tblBook in Datasheet View 9
Figure 5 tblPublisher Datasheet View 9
Figure 6 tblUsers in Datasheet View 10
Figure 7 tblAuthor in Design View 11
Figure 8 tblBook in Design View 12
Figure 9 tblPublisher in Design View 12
Figure 10 tblUsers in Design View 13
Figure 11 frmLogin in Form View 13
Figure 12 frmAuthor in Form View 14
Figure 13 frmBook in Form View 15
Figure 14 frmPublisher in Form View 16
Figure 15 frmMENU in Form View 16
Figure 16 Code Builder for frmMENU 18
Figure 17 qryBooksbyAuthor15in2002 in Design View 20
Figure 18 qryTotalStockValuebyAuthor in Design View 21
Figure 19 qryBooksPublbyLBCin2001 in Design View 22
Figure 20 qryAuthorandTotalStockValuebyAuthorID in Design View 23
Figure 21 qrySearchBook in Design View 24
Figure 22 qrySearchBook in Datasheet View 25
Figure 23 rptBooksPublbyLBCin2001 in Report View 26
Figure 24 rptAuthorandTotalStockValuebyAuthorID in Report View 27
Figure 25 rptSearchBook in Report View 28
Figure 26 frmLogin with UserID 1 29
Figure 27 frmMENU Author 30
Figure 28 frmMENU Book 32
Figure 29 frmMENU Publisher 33
Figure 30 frmMENU Search 34
Figure 31 frmMENU Report 35
Tom owns and operates a bookstore. You believe that you can help him by
creating a database to store the publishers and the books that Tom sells. You
PAGE
\*
MERG
MAT 2
determine that a third table is also required. Your task is to design and
populate the three tables, set the table relationships, and enforce referential
integrity.
system
First and foremost, to help Tom manage his bookstore, we decided to build the database
with 3 main entities: Book, Author and Publisher; and an additional entity: Users.
This bookstore management database lets Tom login to his database and make faster data
storage and recollection. Tom can search for book titles that he sells much quicker, with
features relating to Author, Publisher and Price. This application can assist Tom in his book
store operations by saving time searching for documents without digging through every book
on the shelf. It is also secured with Tom users’ information and password.
Storage: For Tom’s bookstore, the bookstore management system stores each result in
Access, managing 7 authors, 12 books and 6 publishers while also records specific data about
PAGE
\*
MERG
MAT 2
Data Entry: Set up at least one form in Access that allows a user to update at least one of the
following:
Output:
● Display all books published by PubID “LBC” AND the PublDate is 2001 in a report.
● Create a query that display all books written by author 15 and published in 2002.
According to the given information from Tom’s bookstore, we decided to build the
database with 3 main entities: Book, Author and Publisher; and an additional entity to store
PAGE
\*
MERG
MAT 2
Users
Author Publisher
Entity
Relationship
● Each Author can write more than one Book, but each Author must write at least one
book (symbolized by ).
● Each Book must be written by one Author and can only be written by one Author
(symbolized by ).
PAGE
\*
MERG
MAT 2
● Each Book must be published by one Publisher and can only be published by one
Publisher (symbolized by ).
● Each Publisher can publish more than one Book, but each Publisher must publish at
● Users does not have any relationships with the storage of the bookstore database, it only
stores the Username and Password to login in order to use the system.
DSD or Data Structure Diagram is a diagram descripting the conceptual data model
including the entities, relationships between them and obligatory conditions and requirements
Diagram (ERD).
Based on the analysis in the previous step, our group defined 4 entity classes: tblAuthor,
There are seven fields in tblBook: AuthorCode, BookTitle, ISBN, PubID, PubIDate, Price,
StockAmt;
There are six fields in tblPublishers: PubID, PubName, PubAddress, PubCity, PubState,
PubZip.
PAGE
\*
MERG
MAT 2
● 3 relations.
● 2 relationships.
● 3 primary keys.
Rules establishment:
to-many” Relationship.
In each table, a primary key is used to identify each record in the table and guarantee this
record to be unique. In this Bookstore Management System database, the primary key is used for
PAGE
\*
MERG
MAT 2
In this DSD Specification, each table is connected with the other by a “One-to-Many”
relationship:
“AuthorCode”. One author can write many books for different publishers, but
● Between tblBook and tblPublisher, fields “PubID” are connected. One publisher can
publish many books from different authors, but each book ISBN is
● With one book ISBN, one and only one AuthorID, and one and only one PubID is
corresponded.
2. Database Modeling:
● In table tblAuthor, we select AuthorID as primary key because each Author has a
unique Author ID.
● In table tblBook, we select ISBN as primary key because each Book has a unique ISBN.
PAGE
\*
MERG
MAT 2
● In table tblPublisher, we selected PubID as primary key to because each Publisher has
a unique Publisher ID.
● In table tblUsers, we selected UserID as primary key to because each User has a unique
User ID.
a. Background: Select needed Form => Design View => Form Design Tools: Format =>
PAGE
\*
MERG
MAT 2
b. Font, Size and Color of Text: Design View => Form Design Tools: Design: Property Sheet
=> Choose any boxes you want to edit => Edit by Tools in Property Sheet.
c. Insert Buttons: For every form, choose Design View => Form Design Tools: Button (xxxx).
Select the place you want to put => The Command Button Wizard will appear. After the first
and second steps, Categories: Record Navigation and Actions: Find Record for Search
Information Button => Next => Picture: Browse: Choose button icon: Open => Next =>
Finish. Do the steps above and in Actions: Go to the Previous Record for Back Steps; Go to
the Next Record for Next Steps => Next => Picture: Browse: Choose button icon: Open >
Next => Finish. Do the first and second steps, Categories: Record Operations and Actions:
Add new record => Next => Picture: Browse: Choose button icon: open => Next => Finish.
Do the first and second steps, Categories: Applications and Actions: Quit Application =>
Next => Picture: Browse: Choose button icon: Open => Next => Finish.
d. Change Size and Sort: Use resize tools and mouse in Design View to edit.
1. Table creation:
The bookstore data is stored across 3 tables as shown above, the structure of each table
is as follow:
a. tblAuthor:
PAGE
\*
MERG
MAT 2
As for the title of each Author, set the Data Type to “Lookup Wizard” and choose to “type
in the value” that you want. In this case, the 3 values are: “Mr.”; “Mrs.”; “Ms.”.
b. tblBook:
The Data Type for Field Name “AuthorCode” in tblBook is set as LookupWizard to
AuthorID in tblAuthor. The Data Type for Field Name “PubCode” in tblBook is set as
PAGE
\*
MERG
MAT 2
c. tblPublisher:
PAGE
\*
MERG
MAT 2
d. tblUsers:
Change the Input Mask of the field Password to “password” so that the text will be
presented as “****”. The tblUsers table is not used to store data of Tom’s bookstore. The
table is used to store Tom’s Username and Password. Tom can change password or add users
to the bookstore management system so that employees can use the system with Tom. Table
tblUsers is linked to the from frmLogin, which requires users to fill in the information in
PAGE
\*
MERG
MAT 2
2. Form creation:
● Design the lay-out of the Form (change the word font, change the background picture,
etc.)
(Buttons used in this form: to First Record, to Previous Record, to Next Record, to Last
PAGE
\*
MERG
MAT 2
PAGE
\*
MERG
MAT 2
PAGE
\*
MERG
MAT 2
PAGE
\*
MERG
MAT 2
● On the ribbon, choose Create, then select Blank Form, name this form frmMENU.
● Open Design View of frmMENU, in the Controls group, deselect Use Control Wizard.
● In Controls, select Label and add a label on the top of the form, write in BOOKSTORE
● Still in the group Controls, select Tab Control, add a tab with 6 pages, open Properties,
change the tab’s name to TabMenu. Then, to hide the tab names, go to Format and change
● Choose the first page of TabMenu, change the name to PageBlank, go to Format, and
make its Page Index 0. Consequently, name the 2nd page PageSearch - make the Page
Index 1; 3rd page: PageBook - Page Index 2; 4 th page: PageAuthor - Page Index 3; 5 th
● In page Search, add 3 Text Boxes. Change the Labels’ caption to: Book Title, Author,
Publisher. Then go to Property of each Text Box and change the name to: BookTitle,
Author, and Publisher. Add a Command Button and name it Search Book, then go to
Event, On Click, using Macro Builder, select the action OpenReport, rptSearchBook, and
New (…)”, “Edit (…) List”, and “View (…) List” correspondingly. To add new and edit
entry, go to Property of the button => Event => On Click => Macro Builder =>
OpenForm => frm(…) => Data Mode: Add/Edit. To view list of entries, do the same
steps but instead of OpenForm, OpenReport => rpt(…) => View: Report.
● In page PageReport, create 2 command buttons: “Books Published by LBC in 2001” and
“Total Stock Value by Author ID” to open the required reports. Create the link by doing
the same steps as the “View (…) List” buttons but change the View to Print Preview.
PAGE
\*
MERG
MAT 2
● On the Detail section of the Form, add 5 command buttons and change the names to:
● To link these buttons to the pages created in TabMenu, open Code Builder. Add the
following code:
● These codes can be understood as: Once click on the button, the assigned page will be set
focus to and will appear on the screen. PageBlank is used to hide the other pages away
● Add 2 last command buttons to Close Menu and to Exit Access. For button Close Menu,
add action in On Dbl Click => Macro Builder => CloseWindow. For button Exit Access,
add action in On Dbl Click => Macro Builder => QuitAccess. Once double clicked, the
action will be carried out. This is to make sure you do not accidentally close the
PAGE
\*
MERG
MAT 2
● Build a blank form, add combo box and in data, change raw source to tblUser.
● Add text box for password, the default password here is password for username Tom.
● Add Macro as shown below to lookup and compare username with password.
PAGE
\*
MERG
MAT 2
3. Query creation
● On the ribbon above, select Create and then select Query Design.
● For the first field, choose AuthorCode from tblBook, change the criteria to 15 to narrow
● For the second field, write in FullName: [FirstName]+“ ”+[LastName] to combine the
● Choose PublDate from tblBook for the last field, change the criteria to 2002.
PAGE
\*
MERG
MAT 2
● On the ribbon above, select Create and then select Query Design.
● Select Show Total in the Design section of Query Tools on the ribbon above.
● For the first field choose AuthorID from tblAuthor, set the Total as Group By, uncheck
● Write in FullName: [FirstName]+“ ”+[LastName] for the 2nd, set the Total as Group By.
● For the last field, write in TotalStockValue: [StockAmt]*[Price] and set the Total as Sum.
PAGE
\*
MERG
MAT 2
● On the ribbon above, select Create and then select Query Design.
● Add PubID from tblBook to the 1st field, change the criteria to LBC.
● Add PublDate from tblBook to the 4th field, change the criteria to 2001.
PAGE
\*
MERG
MAT 2
● On the ribbon above, select Create and then select Query Design.
● Select show Total in the Design section of Query Tools on the ribbon above.
● For the first field choose AuthorID from tblAuthor, set the Total as Group By.
● Write in FullName: [FirstName]+“ ”+[LastName] for the 2nd, set the Total as Group By.
● For the last field, write in TotalStockValue: [StockAmt]*[Price] and set the Total as Sum.
PAGE
\*
MERG
MAT 2
● On the ribbon above, select Create and then select Query Design.
● For the 1st column, choose Title from tblBook, sort Ascending, then change two rows of
● For the 3rd column, choose FirstName from tblAuthor, sort Ascending, then change the
second row of the criteria to Like "*" & [Forms]![frmMENU]![Author] & "*"
● For the 4th column, choose LastName from tblAuthor, sort Ascending, then change the
first row of the criteria to Like "*" & [Forms]![frmMENU]![Author] & "*"
● For the 5th column, choose PubName from tblBook, sort Ascending, then change two
PAGE
\*
MERG
MAT 2
● Choose Price from tblBook for the 6th column and StockAmt from tblBook for the 7th
● Uncheck the Show box for the 3rd column “FirstName” and the 4th column “LastName”.
● Using the keyword “Like”, and the wild card character “*”, Access will allow users to
search for a book by any characters presented in Book Title and/or Author and/or
● When the user presses the search button on the main menu, Access will retrieve data from
qrySearchBook and show data with any word characters that match the given criteria in a
report rptSearchBook.
4. Report creation:
PAGE
\*
MERG
MAT 2
● Design the lay-out of the Report (change the word font, change the background
b. Create report for Authors and Total Stock Values by Author ID:
PAGE
\*
MERG
MAT 2
● Design the lay-out of the Report (change the word font, change the background picture,
PAGE
\*
MERG
MAT 2
● Design the lay-out of the Report (change the word font, change the background picture,
PAGE
\*
MERG
MAT 2
V. User instruction
a. Login:
✔ Login to the bookstore management system by using the default username: Tom, and the
✔ To edit a User, change the Username and/or Password correspondent to the UserID, but
✔ To add a new User, create a new UserID, Username, and Password; in which the UserID
must be unique.
✔ Double-click on the button Close Menu or Exit Access to execute the command.
PAGE
\*
MERG
MAT 2
a. Author:
✔ On the Navigation Pane, in the Tables section, open table tblAuthor in Design View.
✔ Fill in the new author’s information: AuthorID, FirstName, LastName; in which the
author ID is the primary key and must be different from the existing authors.
✔ Save the new entry by pressing the save button and then close the form.
PAGE
\*
MERG
MAT 2
✔ Use the navigation buttons to choose the author that needs editing.
✔ Save the adjustment by pressing the save button and then close the form.
✔ Use the navigation buttons to choose the author that needs deleting.
✔ Save the adjustment by pressing the save button and then close the form.
b. Book:
✔ On the Navigation Pane, in the Tables section, open table tblBook in Design View.
✔ Fill in the new book’s information: AuthorCode, Title, ISBN, PubID, PubIDate, Price,
StockAmt; in which:
o The ISBN is the primary key and must be different from the existing books;
PAGE
\*
MERG
MAT 2
o The AuthorCode and PubID are chosen from the existing Author and Publisher
list.
✔ Save the new entry by pressing the save button and then close the form.
✔ Use the navigation buttons to choose the book that needs editing.
✔ Save the adjustment by pressing the save button and then close the form.
✔ Use the navigation buttons to choose the book that needs deleting.
PAGE
\*
MERG
MAT 2
✔ Press the save button to save the adjustment and close the form.
c. Publisher:
✔ On the Navigation Pane, in the Tables section, open table tblPublisher in Design View.
✔ Fill in the new author’s information: PubID, PubName, PubAddress, PubCity, PubState,
PubZip; in which the publisher ID is the primary key and must be different from the
existing publishers.
✔ Save the new entry by pressing the save button and then close the form.
PAGE
\*
MERG
MAT 2
✔ Use the navigation buttons to choose the publisher that needs editing.
✔ Save the adjustment by pressing the save button and then close the form.
✔ Use the navigation buttons to choose the publisher that needs deleting.
✔ Press the save button to save the adjustment and close the form.
PAGE
\*
MERG
MAT 2
✔ Use key word in the Book Title and/or Author and/or Publisher to search for the
desired book.
b. View the report for “Books published by LBC in 2001” or “Author and Total
PAGE
\*
MERG
MAT 2
✔ Select “Books Published by LBC in 2001”/ “Author and Total Stock Values by
Author ID”
✔ The report you desire will appear in print preview.
References
Access All In One. (2013, 6 11). Access 2013 08 - Data Entry Forms. Retrieved from YouTube:
https://www.youtube.com/watch?
v=F1xCcc1Cag4&index=8&list=PLLNPs0V_Il08_M24uh2OMAmRurVXYyTle
Access All In One. (2013, 6 11). Access 2013 15 - Dlookup Function. Retrieved from YouTube:
https://www.youtube.com/watch?
v=l6ZywZikcPI&index=15&list=PLLNPs0V_Il08_M24uh2OMAmRurVXYyTle
Access All In One. (2013, 6 11). Access 2013 16 - DateDiff Function. Retrieved from YouTube:
https://www.youtube.com/watch?
v=ei1Yz4XzCQk&list=PLLNPs0V_Il08_M24uh2OMAmRurVXYyTle&index=16
PAGE
\*
MERG
MAT 2
Access All In One. (2013, 6 28). Access 2013 29 - Log In Form 1 - Input Mask. Retrieved from YouTube:
https://www.youtube.com/watch?
v=UjvwlDYOj8k&index=29&list=PLLNPs0V_Il08_M24uh2OMAmRurVXYyTle
Access All In One. (2013, 6 28). Access 2013 30 - Log In Form 2 - Main Form. Retrieved from YouTube:
https://www.youtube.com/watch?
v=L28Kws3VAHw&index=30&list=PLLNPs0V_Il08_M24uh2OMAmRurVXYyTle
Access All In One. (2013, 6 28). Access 2013 32 - Log In Form 4 - Macro To Open And Close Forms.
Retrieved from YouTube: https://www.youtube.com/watch?
v=d05hCj8xdoY&list=PLLNPs0V_Il08_M24uh2OMAmRurVXYyTle&index=32
Access All In One. (2013, 6 28). Access 2013 33 - Log In Form 5 - Open Form When Access Opens.
Retrieved from YouTube: https://www.youtube.com/watch?
v=yQQLnpeJhWE&index=33&list=PLLNPs0V_Il08_M24uh2OMAmRurVXYyTle
Access All In One. (2014, 7 7). Access 2013 31 - Log In Form 3 Dlookup Function. Retrieved from YouTube:
https://www.youtube.com/watch?
v=8qp1m7FXxmU&list=PLLNPs0V_Il08_M24uh2OMAmRurVXYyTle&index=31
Ẩn, T. H. (2017, 7 27). Microsoft Access 2016 Bài 22: NAVIGATION FORM và MENU. Retrieved from
YouTube: https://www.youtube.com/watch?v=MzqBuIcFXAg
Anders Ebro (Microsoft MVP). (2018, 3 23). How to hide the TAB control page headers in a ms/access tab
control. Retrieved from Experts Exchange: https://www.experts-
exchange.com/questions/29090867/How-to-hide-the-TAB-control-page-headers-in-a-ms-access-
tab-control.html
DJ Oamen. (2018, 4 7). How to Create Pharmacy Management System in Access using VBA - Full Tutorial.
Retrieved from YouTube: https://www.youtube.com/watch?v=dXftKmNO8Rw
Kaceli, S. (2018, 1 1). Microsoft Access 2016 Compete Tutorial - Access Made Easy by Sali Kaceli.
Retrieved from YouTube: https://www.youtube.com/watch?v=xRYSP-yFgb0
ob wex. (2017, 2 8). Main Menu or Switchboard form in Access. Retrieved from YouTube:
https://www.youtube.com/watch?v=CqOav3862rY
PC Learning Zone - Computer Training. (2011, 4 27). Microsoft Access Multi-Field Search Form. Retrieved
from YouTube: https://www.youtube.com/watch?v=CTiA_4Me0cI
PC Learning Zone - Computer Training. (2018, 7 15). Microsoft Access 2013 / 2016 Beginner Level 1.
Retrieved from YouTube: https://www.youtube.com/playlist?
PAGE
\*
MERG
MAT 2
annotation_id=annotation_2573298505&feature=iv&list=PLhKFRV3-
UgpeA_3wzRHF8AS8T7ppKvm9O&src_vid=eQMc30gSPN8
Programming. (2015, 5 16). How To Create A Keyword Search in Access 2013. Retrieved from YouTube:
https://www.youtube.com/watch?v=N0X8Hg-Sm6A
Simon Sez IT. (2010, 12 23). Microsoft Access 2010 Tutorial -- Working with Forms -- Part 2. Retrieved
from YouTube: https://www.youtube.com/watch?v=qa4SySktJYM
trinhquangminh. (2007, 7 30). Access Tao Menu Option Group. Retrieved from YouTube:
https://www.youtube.com/watch?v=8Q9CcEj0NJg
user7075507. (2016, 12 23). Using a button to switch between tabs in Access. Retrieved from Stack
OverFlow: https://stackoverflow.com/questions/39414402/using-a-button-to-switch-between-
tabs-in-access
VBA Tips. (n.d.). Build Custom Functions for Your Access Applications. Retrieved from VBA Tips:
https://www.fontstuff.com/vba/vbatut04.htm
PAGE
\*
MERG
MAT 2
PAGE
\*
MERG