PC Review


Reply
Thread Tools Rate Thread

Details on a Report

 
 
silva
Guest
Posts: n/a
 
      29th Dec 2009
I've put together a database for keeping track of vehicle maintenance. I'm
using three tables: The first has the information on the vehicle such as VIN,
make, model, etc. The next table keeps track of when and where service was
performed. It has the date, mileage, and service location. The third and
final table has all the details on the services performed, such as oil change
and tire rotation.

My question has to do with how a search would display items on a report.

What I would lke to be able to do is use a particular criteria in the query
that underlies the report and have all other items done in that service show
up as well. Currently, if I use something like "Oil Change" in the criteria,
it only shows "Oil Change" in the report. I would like to have all other
items such as "Replace Air Filter" and "Machine Brake Rotors" appear with it,
supposing they occured on the same visit, if that makes sense.

Here's my table layout (asterisks denote primary key):

[Table_1]
vehicle
plate
**VIN**
driver

[Table_2]
VIN
date
mileage
location
**record_id** (autonumber field)

[Table_3]
**line_num** (autonumber field)
record_id
description

[Table_1] and [Table_2] are linked via the VIN field.
[Table_2] and [Table_3] are linked via the record_id field.

If any further clarification or information is needed, please let me know.
I'd like to solve this dilemma.
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      29th Dec 2009
Use a subquery as the filter for your report.

If we assume the report is based on a query that uses the 3 tables and
returns Table_2.record_id (but not Table_3.record_id), you could put a
command button on a form and launch the report like this:

Dim strWhere As String
strWhere = "record_id IN (SELECT record_id FROM Table_3 AS Dupe " & _
"WHERE Dupe.[Description] = ""oil change"")"
DoCmd.OpenReport "Report1", acViewPreview, , strWhere

If subqueries are new, here's an introduction:
http://allenbrowne.com/subquery-01.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"silva" <(E-Mail Removed)> wrote in message
news:44FB2D73-36F9-43C3-94BC-(E-Mail Removed)...
> I've put together a database for keeping track of vehicle maintenance. I'm
> using three tables: The first has the information on the vehicle such as
> VIN,
> make, model, etc. The next table keeps track of when and where service was
> performed. It has the date, mileage, and service location. The third and
> final table has all the details on the services performed, such as oil
> change
> and tire rotation.
>
> My question has to do with how a search would display items on a report.
>
> What I would lke to be able to do is use a particular criteria in the
> query
> that underlies the report and have all other items done in that service
> show
> up as well. Currently, if I use something like "Oil Change" in the
> criteria,
> it only shows "Oil Change" in the report. I would like to have all other
> items such as "Replace Air Filter" and "Machine Brake Rotors" appear with
> it,
> supposing they occured on the same visit, if that makes sense.
>
> Here's my table layout (asterisks denote primary key):
>
> [Table_1]
> vehicle
> plate
> **VIN**
> driver
>
> [Table_2]
> VIN
> date
> mileage
> location
> **record_id** (autonumber field)
>
> [Table_3]
> **line_num** (autonumber field)
> record_id
> description
>
> [Table_1] and [Table_2] are linked via the VIN field.
> [Table_2] and [Table_3] are linked via the record_id field.
>
> If any further clarification or information is needed, please let me know.
> I'd like to solve this dilemma.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Report details Michael Microsoft Access Reports 0 26th Jun 2007 10:56 PM
Report Details DS Microsoft Access Reports 2 2nd Apr 2007 02:03 AM
Group Info in Report Footer from Report Details Maurita Microsoft Access Getting Started 2 13th Dec 2006 01:28 PM
TWO DETAILS IN A REPORT? =?Utf-8?B?QUlSIEZPUkNFIFdPUktFUg==?= Microsoft Access Reports 1 1st Feb 2006 12:29 AM
Report Details =?Utf-8?B?QXNobGV5?= Microsoft Access Reports 1 18th Oct 2004 09:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:37 AM.