473,320 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

help with DoCmd.RunMacro

7 of 9
23
I am creating a Module in access to export the results of a query to excel and once there run a macro that i have created. the problem is that this is the first time that I have done this and I am not sure how.

when I begin to write the code access tellls me to put it in the following format:

DoCmd.RunMacro (MacroName,[RepeatCount],[RepeatExpression])


but when i do ittells me,

compile error expected =

what is the correct syntax

Thanks
Jul 12 '07 #1
2 18638
JConsulting
603 Expert 512MB
I am creating a Module in access to export the results of a query to excel and once there run a macro that i have created. the problem is that this is the first time that I have done this and I am not sure how.

when I begin to write the code access tellls me to put it in the following format:

DoCmd.RunMacro (MacroName,[RepeatCount],[RepeatExpression])


but when i do ittells me,

compile error expected =

what is the correct syntax

Thanks
IT can be a bit confusing, especially without examples.
Expand|Select|Wrap|Line Numbers
  1. doCmd.runMacro "yourmacroname"
  2.  
that's all you need. The repeat count applies if you want to run the macro more than once and the repeat expression is an option that lets you run just one expression in your macro multiple times. You don't have to include those to run your macro.
J
Jul 12 '07 #2
7 of 9
23
IT can be a bit confusing, especially without examples.
Expand|Select|Wrap|Line Numbers
  1. doCmd.runMacro "yourmacroname"
  2.  
that's all you need. The repeat count applies if you want to run the macro more than once and the repeat expression is an option that lets you run just one expression in your macro multiple times. You don't have to include those to run your macro.
J
It workes! -Thanks J.
Jul 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: archana | last post by:
Iam unable to run a macro from visual basic... The code does not work when the ms access database(any database ) is open... HELP! Dim strDbName As String Dim strlvsendkeys As String Dim...
4
by: Nathan Bloomfield | last post by:
Hi there, I am having much difficulty with what is probably a very simple problem. I have multiple check boxes, named Check1 to Check10. I would like the code to run macros associated with...
3
by: loran750-google | last post by:
Hello i have that code : DoCmd.RunMacro "Boucle liste user 0", , "!! Is Not Null" I have converted the macro "Boucle liste user 0" to the function ""Boucle_liste_user_0". How can i convert...
0
by: dstyles7 | last post by:
there are two list boxes in a form i have a command populate button that takes the values from the list box and inserts the primary key value from the selected list box into a access table. The...
1
by: corsibu | last post by:
hello , i just wanted to ask if there's anyone who could help me do the following thing : i have an empty temporary table, this table will have a row filled with data grabbed by a querry at this...
7
cori25
by: cori25 | last post by:
I have 4 database's that I need to enter and run a macro in. The macro in each db is named the same. I am having difficulty creating a loop to go into one db run the macro exit and then go into...
7
by: surferj | last post by:
Hello, I am trying to run a macro in that was created in an earlier version of access but getting an error message when i try to run it in 2007. The error occurs on the DoCmd.RunMacro...
9
by: Chris Ahmsi | last post by:
I have been tasked to create a 'simple' form in Access providing managers to input necessary changes. I have 2 command buttons on the form and a check box. Command button 1 updates my table for...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.