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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

problem with crosstab query 1
Forms used to run query 6
Crosstab Query 1
Getting an alternate value by query 13
Query Parameter using multiple options 0
UNION query 11
cross over a criteria from a querie. 3
DSum Code 9

Back
Top