Running Queries Using A Macro


Can I use a macro to run multiple queries in sequence?

I searched on this but did not see anything that indicated how to do this.

Any pointers would be appreciated!



View Replies


Is There A Way To Know What Queries In A Macro Are Running?

I've got a Macro that runs well over 100 queries as well as sub-macros. I'd like to know what query the Macro is running. My best solution so far was to create a bunch of forms that open and close with the name of each query, but that's kind of sloppy. I don't think I can use the msgbox because it prompts me to press 'OK' to continue. Any thoughts?

View Replies View Related

Macro Running Parameter Queries - Version: 2003 (11.0)

I have a macro that runs several queries. Two of them are parameter queries. They both ask for the WCR/QRS Number, so the user has to input the same inforation twoce. Is there an action I can put in the macro to "remember" the information input for the first parameter query and use it for the second?

View Replies View Related

Running Queries


I did 2 ways:

If I created a query named qry1,
then, I created another query (qry2) which include qry1.
Is that meaning running 2 queries?
Firstly, run qry1 result, then run qry2.

Please let me know, thanks.

View Replies View Related

Running Queries From One Excel File To Another


I need to create some form of query that could reference a data range from one already existing Excel file to then import into another.

The scenario is that every quarter I am delivered a number of financial reports from a Credit Risk database that I use to create a final quarterly report. Currently I have to manually cut data from various parts of these reports to create my final report.

I would ideally want to create some method of extracting this data to then import it into another Excel file that I use to compile the final report Excel document. This document has pre created tables and graphs that are dependant on the imported data from the original reports.

This final report tables, graphs are then formatted and placed into MS Word as a linked MS Excel object, allowing any updates to be reflected in the final MS Word doc. The MS objects are not a issue at this stage, I just added this to complete the scenario.

If any Office guru's could offer some resource or light on how I could achieve this, I'd be happy to hear any comments.

Thanks in advance.


View Replies View Related

Queries- Running/Display Results?

Hey guys-
I have a database of properties for sale. I want to calculate the asking prices of each record (for sale) against the sold prices of all the houses in the same area. Area is defined as a numeric number, and each property has one assigned to it. My question is this-
I have a table of all the properties. Do I run the query and store the results in a specific cell in the table- and then use a form to display those results? Or do I run the query from a form and not store the calculated results at all? I will be adding/updating info on a daily basis, so these calculation results will also change daily. Obviously I am fairly new to Access and trying to figure out how to do this stuff. Using Access 2002. Either way, I assume i'll be using a form to display the results one way or another...

View Replies View Related

Running Queries With Multiple Criteria

I need to run a query using a list of unique values. I open a new query in design view, pick my table that I want to use, pick the field, but then in Criteria, I need to use a list of values. The list is 62 values long. Any help here would be greatly appreciated. I hope I am explaining myself thoroughly.

View Replies View Related

Running Queries In Access 2003

Not sure what happens.

occassionally i will run queries that have run before,
the hourglass will turn on, then turn off, and access does nothing
visible, but tack manager says its running 90% cpu. . .

any ideas on what is happening or i am doing wrong?



View Replies View Related

Running Two Queries From One Inputbox Result!?


I have created the following function in my datebase so that i could specify the date a query works from.

Option Compare Database

Function GetParmValue() As Date

GetParmValue = InputBox("Please enter the date you wish to update!?")

End Function

I have a button on a form that runs the query in question, there is also an identical query that needs to be ran using the same result from the input box but rather than it display the input box twice i wondered if there was a way i could use the result from one of the boxes with both queries!?

Here is the code for the button;

Private Sub bImport5_Click()

DoCmd.SetWarnings False
DoCmd.OpenQuery "Update"
DoCmd.OpenQuery "UpdateFuture"
DoCmd.OpenQuery "MoveFuture"
DoCmd.SetWarnings True
MsgBox "Files have now been updated to the specified date and moved to the Future Dated table!", vbOKOnly, "Update Complete"

End Sub

Any ideas guys?

Many thanks

View Replies View Related

Running Queries With VBA - Version: 2003 (11.0)

Hi, I just started using VBA in Access. How would I write code to run queries I've already created and allow the program to stop (so I can review and edit data in a specific table) and then loop back to re-run the same queries?


View Replies View Related

Running Macro

Does anybody know how to execute MSAccess macro through an MSExcel command button?

Thanks in advance.

View Replies View Related

Running A Macro From VBA

I know this is a pretty simple question, but I am having trouble getting it to work. How do I run a macro named "Inventory Update" using VBA? I have the button all set up and ready to go, I just have to add the code that runs the macro. Thank you for your help in advance.

View Replies View Related

Running Multiple Queries. - Version: 2002 (10.0) XP

In the following code thre are three queries that need to happen in the Else section. The code runs the first append query but not next delete query or the third append query. I'm open for suggestions how to get this to work. Thanks in advance.

On Error GoTo Err_SAVE_changes_button_Click
Dim StDocName As String

Cancel = True
MsgBox ("Please provide a valid EVENT date!")
Exit Sub
DoCmd.OpenQuery StDocName, acViewNormal, acEdit

DoCmd.OpenQuery StDocName, acViewNormal, acEdit

DoCmd.OpenQuery StDocName, acViewNormal, acEdit

Exit Sub
End If

Exit Sub
MsgBox Err.Description
Resume Exit_SAVE_changes_button_Click
End Sub

View Replies View Related

Queries Running Really Slow - Version: 2000 (9.0)

The database seems to run slow when it has to query. The 2 tables that are being queried have 8253 and 5414 records. It sometimes takes around a minute to give the results for the users, in which they are complaining about.

I know it has to do with table size, because I ran a little test and reduced the tables to 100 and 153 records and it was fast.

Is there anything I can do to help the performance?

View Replies View Related

Keeping Focus On Main Form While Queries Are Running

I'm sure there is a simple solution - but everything I have tried hasn't worked.
I have a command button on my main form that opens up a popup form. On the popup form the user makes various selections and clicks on another command button(on the popup form). That button is linked to a macro - that runs several queries.

The problem I am having is when the macro starts to run - the main form is maximized again (so now it doesn't take up the full screen - just a part of the screen) and some of the queries start flashing in front of the form.

I know how to maximize the form once the popup form closes - that's not a problem. I just cant figure out how to keep the focus on the main form and in front of all the queries as they are running.

View Replies View Related

Running An Excel Macro From Access

Hi all,

I was hoping that someone could tell me if it is possible to run an Excel macro from an Access database. I am importing 3 Excel worksheets into Access and this macro needs to be run on all 3 evertime that this file is imported by the user (twice a week). If this can be done could someone please tell me how ??

View Replies View Related

Macro Running Module Failure

hey there,
i have a macro that has 2 actions:

set warnings to warning on: NO
runCode to Function Name: cmdImport_Click()

where cmdImport_Click() is a Private Sub in a module within the same database.

when i try to run the macro i get an error that stated
"the expression you entered has a function name that MS Access can't find."

but if i open the module called ImportMSExcelFile and set my cursor on the Private Sub cmdImport_Click() and select the green arrow to run the procedure it runs fine.

any suggetions?


View Replies View Related

Running One Of Many Macro's - Version: 2000 (9.0)

I have macro's for each period in the year, I need to attach some code to a button, which when clicked will run the oppropriate macro based on the period number entered in the period field.

Can anyone please help me ?

View Replies View Related

Macro's Not Even Running - Version: 2003 (11.0)

I can't explain why this is doing this. At one time it was working and now it just wont function period.

I run a macro that runs several queries and closes the database. I run the macro and nothing happens. Now it seems to be happening for any macro that runs a query at all. I run the macro and nothing happens. No error, no query run no nothing. Anyone know what could be causing this? Is there an options setting messed up? I've never had this happen before and I cant find anything on how to resolve it. It doesnt look to be a problem with the macro itself it looks to be MS Access all together. Any help would be greatly appreciated.


View Replies View Related

Running A Macro - Version: 2003 (11.0)


I am currently creating a database for a retail store and i am looking for a way to use a macro to automatically refresh the data on my page.

For example:

Purchase two products
when quantity is changed for first product, total needs to automatically update.

and help and answers would be greatly appreciated

thankyou in advance


View Replies View Related

Running A Macro From Another Database - Version: 97 (8.0)

I have a database that I am working on that combines data from a couple of different sources into one. We need to track the history of some of this data which will end up being very large. To help with this, I split these histories into separate databases and then link the stuff I needed into the primary database.

This allows my primary database to stay around 20-30 mbs and the supporting databases to be anywhere from 20-200Mbs.

What I would like is to be able to kick off a macro in each one of the supporting databases when it is time to update from the primary database. Is this possible? There are 5 supporting databases and 1 macro in each that I need to call. It does not matter how I call the macros as long as it in from the primary database as I would like to be lazy and push one button or call one macro that does everything.


View Replies View Related

Display Progress Bar While Running Queries In Background - Version: 2003 (11.0)

Is it possible to show a Progress Bar while few queries delete and append records from another Access file?
If so how?

View Replies View Related

Macro Keeps Running When Its Done What I Wanted It To Do? - Version: 2000 (9.0)

Hey, I have created a macro which will take all the email addresses of contacts in my databse and send them to outlook, the macro does the following...

- Set Warnings to NO
- Run a make table query to find all the email addresses in the databse
- Set Warnings to YES
- Run the code from a module to seperate each address with ", " and open outlook with the email addresses in the "To" feild

This works fine, outlook opens and all the email addresses are put in the "To" field perfectly.

The problem is that if the user decides they didnt want to send the email and they click the close button of outlook:

They get the error:

Run time error 2501
The send object was cancelled

so you click END then...

An action Failed error appears

and I think the error is because of the code part of the macro. So you then click Halt to get rid of the error.

Is there a way to get rid od these errors?

Thanks for any advice, Dan

View Replies View Related

Macro Running A Report - Version: 2002 (10.0) XP

This will be my second attempt at making a fairly complex macro. There is a report i want to run that has a parameter. that parameter is a week code ( 9/14-9/19 would be week 34 for example). is there a way to generate that number automatically with some vb? i can add a generate a number, but passing it to the parameter field is beyond me. basically the report will be run once a week and the week number will increase by 1 everytime it is run. how do i plug in that number into the parameter automatically? if i had a table with the week numbers i could do a if then statement with the date field, but still dont know how to call those values from vb.

View Replies View Related

Opening Without Running Macro - Version: 2002 (10.0) XP

I have a database that opens, and either through a from or the autoexec macro, the typical command menu disappears.

Rather than building a front end for the data, they did it within the db.

How can I open the Database and not run the autoexec?


View Replies View Related

Automatically Running A Macro On Leaving A Spreadsheet

what do you have to name your macro to make it run automatically on exiting a spreadsheet.
thanks Paul

View Replies View Related

Limit Of Running An Macro To 20 Times. How To Solve This?

Hello Everybody,

I got some errors running my access macro. When I run it I get a message saying that I can only run it for a maximum of 20 times. But this macro needs to run many more times since it needs to filter out date.
Any idea to solve this problem?
Thanks a lot, Bernard

View Replies View Related

Running A Macro Once A Month - Version: 2003 (11.0)

I need to be able to run a macro (which is a series of append queries) once the first time the database is opened in the current month, and then not again until the next month.

I had this code:

If Month(Date) > DMax("Month([CalcDate])", "tblMonSumGOALS") Then
DoCmd.RunMacro "MakeGoalsTable"
MsgBox "already run this month" '----- to test
End If

But then realized that there would be problem at the turn of the year, as 1 is less than 12, but yet it is a new month.

Can anyone steer me in the right direction? I can think of several ways to make it work on a daily basis, but the month change at the turn of the year is throwing me off.


View Replies View Related

Error Running Macro - Version: 2000 (9.0)

I received this particular error msg whenever i run the macro..
"the expression you entered has a function name that Microsoft Access can't find".

In the macro, i hace choose RunCode, and the code is "=CheckDocWithBendahari()"
CheckDocWithBendahari() is the function created inside the module..
I can run the module successfully without macro, but i need this macro since i want to run the modules at particulat time using task scheduler..

pls anyone help..

View Replies View Related

Running A Macro On A Timer - Version: 2000 (9.0)

Is there a way, and if so, how to have a macro run at a predetermined time and day (constant every week, once a week)? Thanks

View Replies View Related

Running A Macro On Only One Record? - Version: 2000 (9.0)

is it possible to run a macro on only one record in the table, the only record i want the macro to run on is the last record entered.
If so how can this be done?
thanks in advance

View Replies View Related

Running A Macro At Night - Version: 2002 (10.0) XP

Hello Everyone,

How can i ran a macro at night when no one is using the database.
I need this function to make an import from a text file to the database.

Please advice,


View Replies View Related

Having An Issue Running A Macro On An XP Machine - Version: 97 (8.0)

Hi all,

I have a macro in my program which runs a series of queries and has worked well for me for over a year on my pc which is running Windows 2000 professional. However I have run across an issue with trying to get this macro to run when I am using an machine with Windows xp insatlled.
I get the following error:

"Invalid setting in the Excel key of the engines section of the Windows registry"

Has anyone run across this type of error before? I'm not sure what to do... I have tried several 2000 pr pc's in the office are and everything works fine. I have also tried several xp pc's and get the same error every time. I have even tried to remove and re-install access97 thinking some piece was missing but no luck. Any guidance would be greatly appreciated!

Thanks a ton!

View Replies View Related

Copyrights 2005-15, All rights reserved