Topics Search

Macro to run reports based on query criteria

Macro to run reports based on query criteria
Views: 36
so be nice
I've got a bit of a macro problem, I'm looking to create a macro which will input criteria, by which reports can be created. I have a report based on a query which asks for the department code, to return all the access data for the department.
I want to create a macro which will create and print a report for each of the departments, by automatically entering the department codes.
Any ideas? Any more detail needed
Sponsored Links:

More topics

 

Criteria for Report/Query being ignored

Preview
I have a report with a record source based on a query that has certain criteria that must be met in a particular field. However, this criteria is being ignored in 4 of the 5 reports. These five reports are similar except that they are dividing all the records up into the five separate reports based on this one field. The only one that is working, is the one whom's data is showing up on the other four reports.

Do I need to show more, or can anyone tell what is going on here? All five reports have their own separate record source.

I have a feeling I might have to explain more
 

Setting up Macro on Criteria filtered Querry

Preview
I have a query that includes a Date/Time field. Currently each time we need to run it we have to change the criteria; for example - Like "*03/05/2012*" to Like "*03/05/2012*", to get query only the data for today.

I have not seen a way to use the Like function and the Date() in the same criteria. Normally not an issue to change it, but it has became evident that we need to run this query very late in the evening, and I need a macro to set the Windows schedule to run it. So need a way to either get the query to only pull today's date, or a macro to change the criteria when it auto launches as scheduled.

A bit of a noob to access, and working with a database that someone else built.
 

access 2007 macro

Preview
I have built 12 queries that obtain data from the same 2 tables but for 12 different reports. I have created 12 separate reports as well. I want to run all 12 queries/reports at once. I have set up a filter in which I enter 'from' and 'to' dates, but I have to do this for each query/report. I want to build a macro that will run all 12 reports at once, and all I'll have to do is manually enter the dates one time at the beginning of the macro. I can not get the date filter at the beginning of the macro to operate successfully - keep getting error message. Where can I get good resource data that will help me with this macro? The Microsoft online help doesn't cut it
 

access 2007 macro

Preview
I have built 12 queries that obtain data from the same 2 tables but for 12 different reports. I have created 12 separate reports as well. I want to run all 12 queries/reports at once. I have set up a filter in which I enter 'from' and 'to' dates, but I have to do this for each query/report.

I want to build a macro that will run all 12 reports at once, and all I'll have to do is manually enter the dates one time at the beginning of the macro.

I can not get the date filter at the beginning of the macro to operate successfully - keep getting error message. The Microsoft online help doesn't cut it.
 

Automating multiple reports with a macro that prompts user for a date range

Preview
A database that I created has a main query that includes a lot of calculations of data that it pulls from a main table. The main query prompts the user for a date range with a "Between [start date] And [end date]" request in the Criteria for the "Date" field.

I have also created many secondary queries that get their data from the calculated fields in the main query.

Finally, I have created about a dozen individual reports that are based upon each of these secondary queries.

I have automated the process of running these reports with a macro that executes the "OutputTo" action a dozen times to save each report as an individual Rich Text file. Theproblem I have is that, when I run the macro, it asks me for the [start date] and [end date] a dozen separate times.

Is it possible to modify the macro to prompt the user one time for the start and end dates and then to pass those dates on to each individual report/query? Or do I need to try to do this with a VBA module?
 

Macro Creation

Preview
I have my report built and is tied to a query. Some background on this: I need to send out approval reports to supervisors for telecom bills. The query is built so that no criteria is specified in the Approver field.

I want to build a macro that will process all approvers, one at a time, and generate reports to the snapshot viewer.

I am pretty new to access and I am not familiar with VB or XML coding. I have the macro built for the first record, but I don't know how to "do until end" type scenario.

Can this be done using the macro actions and not writing code? I am on Access
 

Variable Not passing to query

Preview
I have a command button which when clicked, runs a VBA macro which saves a report to a PDF for the current record. The report is based on a predefined filter for based on the current ID field on the original form.

I have tried setting the criteria field to the current record of the form, setting a variable to the ID field. But the query is not getting the information to compare and the output of thereport is #Type and #Error.

When the macro is run, the query runs and prompts for the information the criteria is looking for.

How do I pass a variable from a form to a query in VBA?
 

Can I manipulate a query for a few different reports?

Preview
I have a query that I would like to base several reports off of. Can I add parameters to the reports so I won't have to have the same query done several times just to change the parameters of what I am looking for?

For example, my database has several different craft codes and ideally what I would like to happen is to be able to use that same query to change the craft codes each time, or skill set. As of right now, I have the same query run with different criteria for each query.

It is the same idea for several reports that I will be running for my executives.
 

Find and Replace Within a Macro

Preview
I have a large macro with a lot of actions to run reports and export them to a shared drive. I basically need to copy the macro, but make it run a different query/report. Is there any way to do a find and replace to change the query and report name within the macro in one step, opposed to going through all the action lines and changing it? This would save me a lot of time.
 

Run macro from combobox NOT based on selection

Preview
Is it possible to call/run a macro from a combobox but it is NOT based on the combobox selection?

I know you can do it based on the combobox selection but that is not what I want. I have the user make a selection from the combobox and store it as a variable under the afterupdate event criteria. Within that same afterupdate event, I want to close the form and run a macro that will allow the user to select a file using the API command dialog box.

I have the command dialog box macro runnig fine and can call it from a button with no problem. Just need to be able to call it from within a combo box.