SlideShare a Scribd company logo
MS Access How To:
Look up and select
values
Unit 18 Database Design
Extended Diploma in ICT
Link tables
• A link table will have foreign keys
• To create a record you want to select a value
from another table and put the key value in
the link table
• You do this using list boxes
Example
• You want to select a customer, then a
costume and put the key values for those
selections into the rental table
Create a form
• Make a form for the link table
• Add the foreign key IDs
Add a list box
• Click on the List Box control and drag out a
list box
• The List Box Wizard starts
List box
control
List box wizard
• Choose the list box to look up the values in a
table or query
List box wizard
• Select the table you will look up
List box wizard
• Choose the fields that will appear in the list
box
• Pick the primary key first
List box wizard
• Choose any sorting that you want
List box wizard
• You are shown a preview
• You now choose to save the primary key
value from the list box in the foreign key field
on the form
List box wizard
• Type a label for the list box
List box wizard
• The wizard closes and the list box allows you
to select a customer and put the ID in the
correct field
Adding a subform to show
more detail
• There are more customer details you may
want to show, such as the address.
• You can use a subform for this
• Click on the subform control and draw out a
subform
Subform
control
Subform
• The subform wizard opens
• Choose to use an existing table or query
Subform
• Select the right table and the fields you want
to show
• You must include the key
Subform
• Choose from the list and the subform will
show the values from the table associated
with the primary key in the link table
Subform
• Give the subform a sensible name
Subform
• The subfom is created (and looks awful)
Subform appearance
• We need to improve its appearance
Subform property sheet
• Set
• Default view to Single Form
• Record selectors to No
• Navigation buttons to No
• Scroll bars to Neither
• Delete the label
Subform appearance
Subform update
• The subform updates when you use the
record selectors, but not when you use the
list box
• Fix this using some VBA (Visual Basic for
Applications)
Subform update
• Select the list box
• Then click on the three dots in the After
Update property
List box
selected
Three dots
VBA
• A dialogue box opens and you choose Code
Builder
VBA
• The VBA code window opens
Space for
your code
Form this
event
applies to
Event this
code
applies to
VBA
• We want the subform to update after we have
clicked to select a customer.
Refresh the
main formRequery
the sub
form
End result
• The data will now match the selection in the
list box

More Related Content

PPT
02 access howtobasicforms
PPT
01 access howtointroduction
PPT
03 access howtofrmmaster
PDF
5.1 Creating a Form Using AutoForm
PPTX
Excelpresentationdatavalidation
PPTX
Excel presentation data validation
PPTX
Excel chapter-8
02 access howtobasicforms
01 access howtointroduction
03 access howtofrmmaster
5.1 Creating a Form Using AutoForm
Excelpresentationdatavalidation
Excel presentation data validation
Excel chapter-8

What's hot (20)

PPTX
Libre Office Writer Lesson 3: Using Styles and Templates
PPTX
05.formatting cells
PPT
Excel Cell Format for Professional SpreadSheets
PPSX
Conditional formatting in excel v2
PPTX
Libre Office Writer Lesson 2
PPTX
Data Management in Excel
PPT
Refworks manual entry - Classic
 
PPTX
Formatting Worksheets
PPTX
Xml For Dummies Chapter 16 Xml And Forms it-slideshares.blogspot.com
PPT
Refworks Manual Entry
 
PPTX
Create an index and update an index in word
PDF
PartsLogistics.com- How to use Research Parts-Solicitations
PPTX
Libre Office Writer Lesson 1
PPTX
Formatting text (Microsoft Excel)
PDF
Print11
PDF
SA05 - Customizing the User Interface
PPTX
Lesson4 Formatting Text
PDF
How to import CSV file into Microsoft Access 2010
PPTX
Lesson 11 Formatting Tables
PPT
Microsoft office access 2003
Libre Office Writer Lesson 3: Using Styles and Templates
05.formatting cells
Excel Cell Format for Professional SpreadSheets
Conditional formatting in excel v2
Libre Office Writer Lesson 2
Data Management in Excel
Refworks manual entry - Classic
 
Formatting Worksheets
Xml For Dummies Chapter 16 Xml And Forms it-slideshares.blogspot.com
Refworks Manual Entry
 
Create an index and update an index in word
PartsLogistics.com- How to use Research Parts-Solicitations
Libre Office Writer Lesson 1
Formatting text (Microsoft Excel)
Print11
SA05 - Customizing the User Interface
Lesson4 Formatting Text
How to import CSV file into Microsoft Access 2010
Lesson 11 Formatting Tables
Microsoft office access 2003
Ad

Viewers also liked (6)

PPT
04 access howtobuttons
PPT
08 benefits of e-commerce
PPT
Ecommerce Security
04 access howtobuttons
08 benefits of e-commerce
Ecommerce Security
Ad

Similar to 05 access howtolookupselect (20)

PDF
Access advanced tutorial
PPT
HARJOT.ppt gggggggggggggggggggggggggggggggggggggggg
PDF
MS Access Subform Success
PDF
Basic Access Notes
PPTX
Priyank Goel PPT.pptx
PPT
HARJOT.ppt
DOCX
How to work a database
PDF
MS Access 2010 tutorial 3
DOCX
Final Project Part 1 (Videos Form) Create this.docx
DOC
Acccesss notes
PPTX
MS Access teaching powerpoint tasks
DOCX
Ms Access
PDF
MS Access 2010 tutorial 4
PPTX
MS ACCESS PPT.pptx
PDF
DOCX
A Skills Approach Access 2013 Chapter 1 Getting Started.docx
PPTX
Access essential training framework
PPT
access1.ppt
PPTX
PPT On MS-Access 2007 | Full Concepts |
PPT
AIA101.3.Access Reports And Forms
Access advanced tutorial
HARJOT.ppt gggggggggggggggggggggggggggggggggggggggg
MS Access Subform Success
Basic Access Notes
Priyank Goel PPT.pptx
HARJOT.ppt
How to work a database
MS Access 2010 tutorial 3
Final Project Part 1 (Videos Form) Create this.docx
Acccesss notes
MS Access teaching powerpoint tasks
Ms Access
MS Access 2010 tutorial 4
MS ACCESS PPT.pptx
A Skills Approach Access 2013 Chapter 1 Getting Started.docx
Access essential training framework
access1.ppt
PPT On MS-Access 2007 | Full Concepts |
AIA101.3.Access Reports And Forms

Recently uploaded (20)

PDF
RMMM.pdf make it easy to upload and study
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Pharma ospi slides which help in ospi learning
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Classroom Observation Tools for Teachers
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Lesson notes of climatology university.
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Insiders guide to clinical Medicine.pdf
RMMM.pdf make it easy to upload and study
PPH.pptx obstetrics and gynecology in nursing
Pharma ospi slides which help in ospi learning
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Classroom Observation Tools for Teachers
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Final Presentation General Medicine 03-08-2024.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Anesthesia in Laparoscopic Surgery in India
Lesson notes of climatology university.
Renaissance Architecture: A Journey from Faith to Humanism
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Insiders guide to clinical Medicine.pdf

05 access howtolookupselect

  • 1. MS Access How To: Look up and select values Unit 18 Database Design Extended Diploma in ICT
  • 2. Link tables • A link table will have foreign keys • To create a record you want to select a value from another table and put the key value in the link table • You do this using list boxes
  • 3. Example • You want to select a customer, then a costume and put the key values for those selections into the rental table
  • 4. Create a form • Make a form for the link table • Add the foreign key IDs
  • 5. Add a list box • Click on the List Box control and drag out a list box • The List Box Wizard starts List box control
  • 6. List box wizard • Choose the list box to look up the values in a table or query
  • 7. List box wizard • Select the table you will look up
  • 8. List box wizard • Choose the fields that will appear in the list box • Pick the primary key first
  • 9. List box wizard • Choose any sorting that you want
  • 10. List box wizard • You are shown a preview
  • 11. • You now choose to save the primary key value from the list box in the foreign key field on the form
  • 12. List box wizard • Type a label for the list box
  • 13. List box wizard • The wizard closes and the list box allows you to select a customer and put the ID in the correct field
  • 14. Adding a subform to show more detail • There are more customer details you may want to show, such as the address. • You can use a subform for this • Click on the subform control and draw out a subform Subform control
  • 15. Subform • The subform wizard opens • Choose to use an existing table or query
  • 16. Subform • Select the right table and the fields you want to show • You must include the key
  • 17. Subform • Choose from the list and the subform will show the values from the table associated with the primary key in the link table
  • 18. Subform • Give the subform a sensible name
  • 19. Subform • The subfom is created (and looks awful)
  • 20. Subform appearance • We need to improve its appearance
  • 21. Subform property sheet • Set • Default view to Single Form • Record selectors to No • Navigation buttons to No • Scroll bars to Neither • Delete the label
  • 23. Subform update • The subform updates when you use the record selectors, but not when you use the list box • Fix this using some VBA (Visual Basic for Applications)
  • 24. Subform update • Select the list box • Then click on the three dots in the After Update property List box selected Three dots
  • 25. VBA • A dialogue box opens and you choose Code Builder
  • 26. VBA • The VBA code window opens Space for your code Form this event applies to Event this code applies to
  • 27. VBA • We want the subform to update after we have clicked to select a customer. Refresh the main formRequery the sub form
  • 28. End result • The data will now match the selection in the list box