Report of only one entry

capsula4

Registered User.
Local time
Today, 12:31
Joined
Jan 3, 2008
Messages
122
Hi! I would like to know if it can be made a report (or query) of only one entry, or if it exists a way to filter the report so as to show only one "ID" and all the sub-items it has.

Thank you!
 
You can either add a criteria to the query or use the wherecondition argument of OpenReport to restrict the records displayed on the report. Typically master/child links would handle the items in a subreport.
 
Thank you pbaldy!

Excuse my ignorance, im a bit newbie to Access, where can I add these criteria or wherecondition arguments? If someone can tell me in some steps it would be really nice! :D
 
The terms you want to search on are "parameter" query to add a criteria (you'll use the Criteria row of the query design grid). For the wherecondition, look in VBA help at OpenReport; the wherecondition is one of its arguments.
 
Thank you Paul!! I could make it work using the criteria thingy!!
 
I'm not sure how this should work.

I added a parameter using a column's name. When I enter the query it asks for the parameter value but it doesn't filter the query.

Nevertheless, when I create a report using that query, it asks as well for the parameter but this time, it does filter!!

Is this the way it works?
 
No, if you have a criteria on the query it should be filtered. Hard to say what's wrong without at least seeing the SQL of the query, or even a sample db.
 
No, if you have a criteria on the query it should be filtered. Hard to say what's wrong without at least seeing the SQL of the query, or even a sample db.

Oh, this time I didn't use criteria! I just created a parameter in the Query.

Example of query:

[TRANSACTION N°] | [PRODUCT] | [PRICE]
-----------------------------------------
1 | GARLIC 1 | 5
1 | GARLIC 2 | 5
2 | GARLIC 1 | 6
3 | GARLIC 3 | 2

Then I add as parameter "TRANSACTION N°"

Each time I enter the query, it asks for "TRANSACTION N°" and I may enter 1 but shows the 3. Instead, when I enter the report based on this same query, it would filter without any problem.

If this shouldn't be like this and u have any idea of why this might happen, I appreciate it.
 
Can you post a sample db?
 
Hey! Here I have attached a sample DB using the parameter, but it is not working okay.

In the query, it doesn't filter.

In the report, it just shows one persons name, but it shoes the items of the rest of the people.
 

Attachments

Okay, you entered it in the parameters declaration area but didn't actually make it a parameter (criteria). Try this

PARAMETERS [Enter Name] Text ( 255 );
SELECT PERSON.ID_PERSON AS PERSON_ID_PERSON, PERSON.NAME, PERSON.SEX, items.ID_ITEMS, items.ID_PERSON AS items_ID_PERSON, items.[ITEMS BOUGHT]
FROM PERSON INNER JOIN items ON PERSON.ID_PERSON = items.ID_PERSON
WHERE (((PERSON.NAME)=[Enter Name]));
 
Thanks Paul! I don't wanna seem to be so silly but I don't get where do I have to put all that "code" you posted above. :confused:
 
Open your query in design view, then View/SQL View. You'll see the SQL of your existing query. Delete what's there and paste that in and give it a try.
 
Thank you a lot Paul!! Specially because of being so patient with me!! :D:D

Now I could make it work withouy any problem! ;)
 
No problem; glad you got it sorted out.
 

Users who are viewing this thread

Back
Top Bottom