Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Access Guide 2

Contents

Displaying data as % in Access table ............................................................................................................. 1


Make a query that has search criteria for the % field................................................................................... 2
Vertical adjustment to display a Report on One Page .................................................................................. 2
Display Calculated field as % in a report ....................................................................................................... 3
Do a summary Query that works out Average and the Number of records................................................. 5
Exporting Tables and Queries as .CSV files ................................................................................................... 5
Exporting Access Tables, Queries and Reports into Word and Excel: .......................................................... 7
Setting up Primary Key.................................................................................................................................. 7
Setting up a drop down menu for a field of a table ...................................................................................... 7
Hide data and labels in a Report (Property-Visible) ..................................................................................... 9
What to do if you make a mistake when you are making a Query or Report .............................................. 9
Adding search Criteria for whole number fields in Queries ......................................................................... 9
Displaying data as % in Access table
Open the .csv file Access_Overall_Practice/Percentage_Completion

Load it in the usual way. (External data, Text file)

The completion field in the CSV file is a short decimal number (0.15 for example)

We want to display this as 15% in the database.

Make sure that you select the file type in the advanced window as single (single means
short decimals, double would be long decimals, single is enough for our data) during the
importation of the data.

Save the database into your working area.

Open the table, it should look like this: (The percentage figures are still decimals)

Go into design view and change the format for them to Percentage.

(Without decimal places)

1
The Completion field should have proper % figures in it, see below.

Make a query that has search criteria for the % field


The query should show:

 all of the fields from the table,


 sorted on Completion in Ascending order,
 has a calculated field called difference: Difference = Potential area –Current area
 Only shows where the completion is bigger than 20%.
This is where you have to be VERY careful, if you type in >20 or >20% it is not
going to work, because the database is still storing the % numbers as
decimals!!!!! It is only the formatting that you changed to %, the numbers are still
decimals! What you need to type is >0.2
Be careful, >0.2% would not work, no need for the % sign!
 Country should be: Not America

Vertical adjustment to display a Report on One Page


Make report that is based on the query above and only shows:

 Reference, Country, Current area, Potential area, Completion fields


 Sorted on Reference into Ascending order
 The page orientation is Portrait
 The report fits onto One page
Important note! To see whether the report fits on one page, you have to go to
Print Preview, the Report view is not good enough!

How to display report on one page:

2
Circle the boxes in the details section to select them all

Then drag them up as far as you can, this will create some space at the bottom of
the detail section

Space

Then close the gap by dragging the page footer upwards.

Go to print preview to check if the report fits on one page

Display Calculated field as % in a report


The report also should:
 Shows Labels and data fully! Remember, if you make a mistake, UNDO is your
best friend
 Does not show the Date and the Page number
 Title says Completion report
 The number of records on the report is also calculated and show with a label
next to it saying: “Entries” (This is explained in Guide 1 Page: 28-31)
 The min and max of the completion is calculated and the result is shown as %
with labels next to them saying “Min completion”, “Max completion”. Reminder:
make sure you add the calculations to the Report Footer, NOT to the Page footer
(This is explained in Guide 1 Page: 28-31)
3
 This is what you will see before converting it to %

Right click on the number in design view, Properties, Format, pick Percent, no decimal
places (This is explained in Guide 1 Page: 28-31)

And it changes!!!

Here is the finished report.

4
Do a summary Query that works out Average and the Number of records
It is called summary, because it does not show every record from a table, it works out
Min, Max, Average, Sum for records that belong to the same category.
(You can also find this in Guide1 page 53-55)

 Called Average Area


 Shows a summary of only the Country, Current Area
 Performs a count of each Country (so it works out how many times each
country is in the report)
 Calculates the average of the Current Area for each Country
 Sorts the Country field into ascending order.

See guide 1 page 53-55 for how to do the query above if you cannot remember.

Exporting Tables and Queries as .CSV files


 Export this query as .CSV to your working area.

Do a right click on the query you wish to export, select export and choose text file.

5
No need to tick any options for the box above, but you have to change where you want
to save and also the file name and the file extension, it should be .csv

Click Browse, find the folder you want to save into, type in a suitable File name with
extension! (.csv)

For the type, select: text files (txt, csv, tab, asc)

If you have done it right, it will open the Export wizard, and you need to complete the
usual steps you do when importing data.

6
Find the file in the working area to check.

Note: You can save Tables and Queries as .csv files, but it makes no sense to try to save
Reports because you cannot save formatting in .csv files!

Exporting Access Tables, Queries and Reports into Word and Excel:
 Exporting Tables: Right click on Table, choose Export then Choose Excel or Word
RTF File.
 Exporting Query into Word and Excel is explained in Guide1, page 50-52
 Exporting Reports: Right click on Report, choose Export then Choose Excel or
Word RTF File.

Setting up Primary Key


If you do not set up a Primary Key or you set it up wrongly during the Importation of
data into Access, you can still change the Primary Key in the Design view of the Table.

Just right click on the Key symbol, and switch it On or Off as needed.

Setting up a drop down menu for a field of a table


You would do this, so the user can only select values from a drop down menu when
entering data into a table, hence you can stop silly entries.

In design view of the table, select the field then


Lookup Wizard.

7
You choose I will type in the Values I want.

Type in the countries you want then click Next

Type in a suitable Label name, then Click Finish

8
Save the table, go into Datasheet view, click on one of the countries, you will see a drop
down menu opening up with the countries you added to the list.

Hide data and labels in a Report (Property-Visible)


If you have to hide/unhide data or labels in a report, you just go into Design View, right
click on the Data box or Label then choose Properties. This is where you can switch
Visible to Yes/No.

What to do if you make a mistake when you are making a Query or


Report
If you make a mistake, when creating queries or reports, (for example you forget a field
or sorting), you should just create the query/report again, it is easier than trying to fix it.

Adding search Criteria for whole number fields in Queries


When trying to add search criteria to a query for a field that has WHOLE NUMBERS only
(Integers), remember: <=2 is the same as < 3

9
10

You might also like