Creating Reports

G

Guest

Hi

Can anybody explain to me how to create reports?

I am trying to build myself a Real Estate Listings Database, that will allow
me to add listings and then search and create reports.

My problem now:
I have created a table called houses, where I will add houses for sale,
another table called area, where all the suburbs are listed, and a form
called houses, where I then add the details of the house for sale, and select
the suburb where the house is located.

I have created a report called houses, and this then displays the houses in
the database.
So far so good. But how do I go and create reports for each suburb, listing
only houses for that particular suburb?
Do I have to create a separate table for each suburb? And a separate report
for each suburb?

If so, how do I create a form that allows me to select the suburb and then
enter new data for that suburb,
and how do I then link this form to all the tables?

Would be grateful for an answer to this problem.

Thanks
Hans
 
R

Rick Brandt

hbsnam said:
Hi

Can anybody explain to me how to create reports?

I am trying to build myself a Real Estate Listings Database, that
will allow me to add listings and then search and create reports.

My problem now:
I have created a table called houses, where I will add houses for
sale, another table called area, where all the suburbs are listed,
and a form called houses, where I then add the details of the house
for sale, and select the suburb where the house is located.

I have created a report called houses, and this then displays the
houses in the database.
So far so good. But how do I go and create reports for each suburb,
listing only houses for that particular suburb?
Do I have to create a separate table for each suburb? And a separate
report for each suburb?

If so, how do I create a form that allows me to select the suburb and
then enter new data for that suburb,
and how do I then link this form to all the tables?

Would be grateful for an answer to this problem.

Thanks
Hans

You need to learn about queries. Probably one the most important things in a
database. With a query you can combine the data from multiple related tables
and also apply criteria to filter on records having certain attributes.

In your case all you need is a criteria in your query to specify which suburb
you want to see.

An alternative would be to open the report from code behind a button and have
that code apply a filter to the report.

DoCmd.OpenReport "ReportName", _
acViewPreview,, _
"Suburb = 'SomeSuburb'"

The value for the filter can even be pulled from a control on a form so the same
code can filter on any suburb. Suppose I choose the suburb from a ComboBox...

DoCmd.OpenReport "ReportName", _
acViewPreview,, _
"Suburb = '" & Forms!FormName!ComboBoxName & "'"

Both examples above assume the suburb value is text. For a numeric value just
eliminate the single quotes.
 

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

Top