Generate a report from filtered results

Sean91

Registered User.
Local time
Today, 04:43
Joined
Apr 14, 2009
Messages
17
In access 2003 is there a way to generate a report that only contains the records from a filtered form and not every record?

Cheers
 
what do you mean. I mean you can always customize your reports' recordsource same to the forms' recordsource.
 
Using the search button I made, I filter the results and then I have a button to generate a report but atm it just shows all the records and not just the ones left after i have filtered it, I would like to just see the filtered results on the report
 
what is your reports recordsource? maybe you can also apply the recordsource of your form to your report.
 
SELECT * FROM [IT _Assets_table];

It changes depending on the search criteria. Is there away to add a wild card?
 
let me clarify this. you want your report to show records in your form right?
 
Other way around the records, the form is displaying to be shown on the report, hence the filtering of the records in the form
 
Using this code on a button "generate report" I can bring up a report with all my records displayed.

Code:
Private Sub Genrpt_Click()

    'Open report
    DoCmd.OpenReport "rptassets", acViewPreview, , GCriteria
    
End Sub
I would like to know, is there a way to modify this code so the report uses my form to get its data? This is so when you use the search function on the form to filter the records down you can produce a report with only those records.

Edit: I have tried setting the record source in the report and the form the same but had no luck.
 
I don't really understand what you are doing. What you are trying to do should be very easy. Can you post an example of your database with the form that filter your records its source and the report you want to show the records? I will take a look at it.
Cheers!
 
Basically you open up frmView, click search enter the search criteria and it filters the records (select asset type in combo and type PC into textbox...Just a simple example), then when i click the generate report button I want it to show only those records and not every record
 

Attachments

you have indicated herein your code that goes:

"SELECT * FROM [IT _Assets_table];"

is this your whole code for your record set? actually this does not filter what you may want. you can add:


SELECT * FROM [IT _Assets_table] where criteria= criteria here";
 
That's good at least it filters the report, is it possible to show all the results of the filter by clicking generate report or can you only show them in the report one at a time?
 
yes it is possible. study how the query works, modify create a code base on the query and make it as a recordsource of the report.
 
Cheers, I'll have a go at it once I finish my other work :)
 
I don't know if I'm out of place here, but there is ALOT of M$ CD-Keys listed in his table. Can't we modify the example, not delete, so others can learn, but no one can take these keys.
 
Sean91: It would also depend on how your form is filtered? Are you using the Filter property?
 

Users who are viewing this thread

Back
Top Bottom