Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a generic query/report to retrieve specific data

Status
Not open for further replies.

Scoob55k

Technical User
Nov 16, 2005
62
US
Hopefully I can describe this here.

What I want to do is create a query/report that will retrieve data from specific table fields that I have selected using combo boxes in a Microsoft Access form. By doing this I can reduce all the reports I have to a minimum as most are exactly the same except for one field of which I want to select using the form.

I have the query retrieving all the data I need except for the specific responses in the field I need. I've tried to rename the field in the query using: Response: Forms![frm Reports]![Combo Report] for example, however this does not allow me to have the table named or doesn't work if I put it in there.

 
I think this would be a better question for the Access forum, but what you need to do is create a SQL query in VBA and use this string

Forms("frm Reports").Controls("Combo Report").Value

to define your dynamically set field.

You then want to set your reports recordsource to the created SQL statement. All this would still be done through VBA. I have posted on this recently, I will find the thread and reply back with the link.

The way you have it set up I think it would return either nothing or the selected value of "Combo Report" for each row.

Hope this helps,

Alex

It's a magical time of year in Philadelphia. Eagles training camp marks the end of another brutal season of complaining about the Phillies.
 
This sounds similar to your problem. Be sure to select your dynamically set field as Response{/b] each time so that you only need to refer to 'response' in your report design.

thread705-1272023

Good Luck,

Alex


It's a magical time of year in Philadelphia. Eagles training camp marks the end of another brutal season of complaining about the Phillies.
 
Thanks Alex. I printed both posts off and we'll give it a shot. Thanks again! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top