Office 2010 - Access

Lesson 52: “Controls” (8)

52/76 Lessons 

Pop-Up form (3)

In the next window, we first give the easy fields, by clicking the respective downward pointing arrows.
In the top box, we choose the form that serves as a pop-up form.
In the “View” select “Form”.
In the “Data Mode” choose “Read Only”.
And in the “Window Mode” choose “Normal”.

les50_WHERE_image006_en
We then present the “WHERE condition” in the box. It seems confusing but, “Access” will help us. The only thing you need to know is where it should go to get the information and a condition which this information must comply with.

We begin with the opening of the square brackets ([).
Then we type the condition. The condition is the “City” because the place of residence for each of the records in the pop-up form is the same as that in the main form.
Once we enter the first letter say, W, in the field, “Access” gives us all the possibilities in a list.
Double-click “City” herein.

les50_WHERE_image001_en

Access automatically adds a closing bracket (]). The condition is already placed.

We continue with typing the equals sign (=), open again the square brackets ([) and type an F.
The ‘F’ forms, because we are looking for form objects here.
Automatically displays a list of the different possibilities.
Double-click the “Forms”.

les50_WHERE_image002_en

“Access” automatically closes the square brackets (]).
Type the exclamation point (!).
“Access” opens the list the different options again automatically.
Double-click the main form “student_per_city_popup”.

les50_WHERE_image003_en

“Access” automatically closes the square brackets (]).
Re-type the exclamation point (!).
“Access” opens a new list with different options.
Double-click “City”.

les50_WHERE_image004_en
“Access” closes the square brackets (]) automatically.
This is the code that you should now have in the “WHERE condition”.

les50_WHERE_image005_en
Close the window by clicking the X icon (1) in the top right, and save the code when prompted.

les50_WHERE_image007_en
Test the form in “Form View”.
As you will see, all students from “St-Niklaas” appear in a pop-up form when we click on the “City” button in the main form.
les50_image013_en
We select a student in the main form that lives say in , “Lokeren” and we click the “City” link again in the main form, all students from this city appear in the pop-up form.

les50_image014_en

Awesome!
You've completed Lesson 52
START NEXT LESSON