how to click "Yes" in a macro.....

I have a number of queries set up in a macro, however some ask for approval before finishing, i.e. append xx records. How can I have that automatically approve and continue to the next query

Sponsored Links:

Related Topics

Error message when trying to use a custom macro
It is my understanding that a custom macro was built to pull text data from a file and import it into Access in the appropriate fields. This macro no longer works and will return the following error message:

"License information for this component not found. You do not have an appropriate license to use this functionality in design mode."

It only gives an option to click OK. When you do it shows a box called "Action Failed" that lists the macro name, condition, action name, and arguments with three button to click on the right of the box: "Step" "Halt" and "Continue". It appears that only the "Halt" button is available to be clicked.

Also, we're not sure if the macro currently exists.

Does this sound like an issue with the Access license or whatever license the macro might have? We're trying to decide if it's possible to restore the functionality of the macro.


Use a macro to show the form name in a msgbox
I want to build a macro which shows in a MsgBox the name of the form from which this macro is started (the macro runs when a click a button on the form). So I tried the build a "MessageBox" macro and set its "Message" parameter to but the msgbox returns exactly "Me.Name" instead of the form name.

Well, I must admit that I am not surprised but can anyone helpme how to reference the Form.name property from within a macro?


Single Macro for 600 buttons?
I have a form with upwards of 600 buttons whose captions are sequential numbers. When I click any particular button, I need the underlying table to register a yes/no, AND I want the button to change color (text or background). I can figure this all out easily if I set up a macro for each button, but I would like to use just one macro and have it pull the caption, which matches the underlying field it should change.

For instance, for the "5" button, when I click it, I want the "5" field in the underlying table to change to YES - when I click the "22" button, I want the "22" field to change to YES.can this be done with a single macro or VB script


Access Quit Command not working in Macro
Im trying to get a macro to run on access. I tried to do the command quit to close Access after the macro runs, but it doesnt work it gives me the error: The Command or action Quit isnt available now.
* You may be in a read-only database or an unconverted database from an earlier version of Microsoft Office Access
*The type of object the action applies to isnt currently select or isnt in the active view.
I made sure the database is in a trusted location and checked all the security settings. I am using access2007.

On last note- If I double click the macro it works, if I click on "Run Macro" or right click and select "Run Macro" it does not work


Need to create a macro to click YES for me
I use an access form to send some 600 emails with a SNP format report as an attachment. Problem is I get the outlook prompt "a program is trying to automatically send on your behalf"

Can someone help with creating a macro to simply click yes.

Problem is I do not think clicking yes is possible, but I've heard this command would be help:

Application.SendKeys ("%s")

Im not that knowledable with macros or vba scripting unfortunately


2 things - SetWarnings? and Running a saved Import
I'm using Access 2007 and two things I used to know how to do I have either forgotten or can no longer find.

From within a macro I used to "setwarnings" to off so I wouldnt keep having to click "yes" or "ok" - is there a different way of doing this from within a macro?

Secondly, I want to run a saved import from within the macro - any ideas?

Cant believe either of those is too hard


Macro to open form to a particular record
I have two forms: "Employees" & "Employee Badge".

I want to create a button in "Employees" form and press it, so that "Employee Badge" form opens displaying only the record that was on the "Employees" form at the time I pressed the button.

I have created a macro to do this. The "Action" of this macro is "OpenForm".

Can someone please tell me what I need to put in the "Where Condition" of the macro?
Or is that "something" entered in "Filter Name" of the macro?


Populate Date field (CurrentDate + 30) in table if blank
I have a "Print" button on a Form called "Invoices" that has embedded macros on the click event I want to replace with VB code due to the limitation in Macro. Currently this Macro does the following

1. Opens and runs a query called "SubtotalUpdate"
2. Opens and runs a query called "InvoiceTotalAppend"
3. Opens and populates a Report called "Invoices" with the DueDate from "Invoices" table before printing.

This is what I want to add to the existing macro all converted to VB

4. If the DueDate field is blank in the "Invoices" table I want the date saved in that blank field in the table as (Current date + 30 days) before executing option 3. The format of the date should be mm/dd/yyyy. Can I replace this macro with a VB code. Can you please help with the code on Click


Macro Setting
I am setting up a macro and in it the is a "make a table" query that would require the user to click on "yes". Is there a way that popups don't appear and yes is the default?


Pause macro to get user input?
I need to pause an Access macro to get the user to have a "second chance" - i.e. "Are you sure? Y or N" dialog with control buttons to click for yes or no response. The problem is, I can't figure out how to stop the macro from continuing while the dialog is pending.

I know that I can always have the call to the dialog then start a new macro from the buttons, but I want an "all purpose" dialog. sort of a free standing function that can be inserted into several different macros for diff purposes instead of each having its own form and secondary macros.

PS - it has to be backward compatible to Access


DBL Click - Macro Builder
Hoping I can get some help using the "Macro Builder" as I have no idea on how to use or write VB. Please redirect me if this is the wrong forum.

I have a subform that houses a list of contacts by the firm number in the parent form. There is also another form within the DB that has additional contact information that is editable. What I would like to do is to "double click" on an individual record in the subform and have it open the specific record in frmContact.

As previously mentioned, I need to build an expression in the "Condition" field to specifically pull a certain record. I have attached a pic of the MacroBuilder as well as the DB itself


Populate Date field (CurrentDate + 30) in table if blank
I have a "Print" button on a Form called "Invoices" that that has embedded macros on the click event I want to replace with VB code due to the limitation in Macro. Currently this Macro does the following

1. Opens and runs a query called "SubtotalUpdate"
2. Opens and runs a query called "InvoiceTotalAppend"
3. Opens and populates a Report called "Invoices" with the DueDate from "Invoices" table before printing.
This is what I want to add to the existing macro all converted to VB code
4. If the DueDate field is blank in the "Invoices" table I want the date saved in that blank field in the table as (Current date + 30 days) before executing option 3. The format of the date should be mm/dd/yyyy. Can I replace this macro with a VB code. Can you please help with the code on Click event


Error msg "Can't find the macro '.'
I am receiving the following message when try to access my form. ("my database" can't find the macro '.' ) Yes, that is a dot between two quotes.

I checked the click events and there are no additional spaces. I do have code behind my click events, none of which access any macro's.

I compacted and repaired the DB.

Does anyone have any ideas on what else I can check


Linking Report info to input Forms
I'm having an issue with building an "on click" macro for a current inventory report. If the user clicks the Primary Key (Intake_Number) it automatically opens a dialog, modal input/edit form.

I can't get the edit form to display the record clicked in the report. The filter I applied to my "on click" macro to open the form is as follows:

="[Intake_Number]=" & [Intake_Number]

I'm thinking I might have to build an on load macro for the form but I'm not sure how I would get the information to display.


a macro can call itself a maximum of 20 times???
I have a button on a form and on the click event of this button I have a macro to print but I am getting this error "a macro can call itself a maximum of 20 times".

On the form the user enters data and when completed they will click on the button to print the report. If a condition on the form has not been met a msg box will prompt the user. What I have noticed is that if I close the form then open it again I can print the last record but if I try to change a field I get the "a macro can call itself a maximum of 20 times" again?

I have checked that I have not ask for the macro run 20 times.

Been looking on other sites and seen this: RunTime error 2525 what does this mean?


View Macro Result in subform
I have created a macro name "MonthwiseRep" to view select query result in pivottable view which works fine when I run the macro.
But problem occurs,
if I wish to populate subform on a click of a button that I have on the main form with the same macro results as "MonthwiseRep" in pivottable view.

I tried the following code for click event of the command button but it didn't work

Me!Child21.SetFocus
DoCmd.SetWarnings False
Me.Child21.SourceObject = MonthwiseRep
DoCmd.SetWarnings True
Me.Child21.Requery


Macro to close forms
I need to make one macro that will close the current form and open another one. I need to use this on many forms so I just want to make one and apply it to a "Double-click" event on a picture on each form.

The form that is opening is the same each time "frmopen" but my problem is I don't know how to close each form using a generic expression in a macro. Tried "screen.activeform" under form name. but didn't work.


Error Using "Browse To" Macro Command
If you click the "Report Center" tab at the top of the main navigation form, on the right side of the page there are three links: two of them display reports as a subform on the page, and one of them displays a pivot chart.

The "On Click" event for each of these links uses the "BrowseTo" macro command to swap out the default subform on the Report Center form with the desired form or report.

If you are not familiar with the BrowseTo command it is described in more detail [LINK].

Here is the problem: when you first click the link "Active Agreements Chart" the pivotchart will load on the page, but if you then click either of the other links (ActiveAgreements or Expired Agreements) you get an error saying "The command or action 'BrowseTo' isn't available now." This only seems to happen when you try to navigate to one of theother reports from the pivotchart.


Adding If Statement Argument to Existing Macro
In the Event property "On Click" When you Click the Print button on the Invoice form, If the DueDate field in the Invoices Table is Blank, Populate that field in the table with todays date + 30 days. That Print button already has a macro embedded in it and the Where Condition has the following macro. I just want to add on this macro or show me a better way of doing this.
Existing Macro

Action Arguments
OpenReport Invoices, Print Preview, , [Invoices.InvoiceID]=[Forms]![Invoices]![InvoiceID], Normal


Each time I click run different code
I would like to know how can I code, an event in a textbox, so each time I click on it, a different option appears in it.
I know how to give a value to the textbox for the first click (Forms!frmCalendar!txtDayBlock01.Value = "yes"), but no idea how to change this value after each click.

Let's say:

I've text box , on click event once I want to appear "Yes", on click the second time "No", third click "Maybe", Forth "No way", and then fifth will start again with "Yes