Queries

  • Thread starter Thread starter Neil Greenough
  • Start date Start date
N

Neil Greenough

I am having difficulty getting my head around queries. What are they all
about?

Basically, I have a contact database which lists employees and their
departments. In the contact form, you select that specific employee's
separtment from a combobox which looks up another form.

What I want is to create a contacts reports, whereby I can select a
department from a combobox in a form, click go and a contact report appears
for all those employees in that specific department. Do I need a query for
this? How do I go about it?
 
I am having difficulty getting my head around queries. What are they all
about?

A Query is a tool that allows you to select which fields, and which
records, you want to see from a table (or from more than one tables,
joined appropriately).
Basically, I have a contact database which lists employees and their
departments. In the contact form, you select that specific employee's
separtment from a combobox which looks up another form.

What I want is to create a contacts reports, whereby I can select a
department from a combobox in a form, click go and a contact report appears
for all those employees in that specific department. Do I need a query for
this? How do I go about it?

Yes. Create a Query based on the table - or tables, e.g. the Employee
table joined to the Department table - and use this Query as the
Recordsource for the Report. On the Criteria line of the query type

=[Forms]![yourformname]![cboDepartment]

under the Department field. Put a button on the Form to open the
Report (the wizard will help you do this). Then the Report will use
the Query, which will look to the Form for the criterion to select
only the employee records for that particular department.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top