Macros in adp

doco

Power User
Local time
Today, 11:26
Joined
Feb 14, 2007
Messages
482
I am new to Access Projects.

Is it common for the scope of a macro to only be during the current instance of Access? I notice that creation of a macro does not have the subsequent request to save, etc. Then after closing a session of the ADP and reopening the macro no longer exists.

I am using Access 2007. Is there as there is with so many things in 2007, a deeply buried and grossly unintuitive 'new' process of saving macros in 2007? Or as I suspicion no way to preserve macros in an ADP? :confused:

TIA
 
Hi Doco!

Long time no chat. Hope things are well with you.

From your post, it sounds like you create a macro in a 2007 ADP, but then the macro never gets saved. Is that correct? That seems very odd.

Can you give me some more information on exactly what you're doing?
Are you creating a macro object (one that appears in the Navigation Pane) or are you creating an embedded macro (one that is saved directly within a form or report event?
What actions is your macro performing?
Are you prompted to save the macro when you close the macro window?

Thanks,
--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 
Hello Jeff! Central Oregon misses you! Doing very well thank you.

First I notice there is no [ Macro ] selection from the object pane...

So, I select [ Macro Builder ] from an event field of the properties pane. Then choose OpenForm, etc from the subsequent Macros Wizard. At no time am I prompted to save the macro; and, clicking the save file icon in the upper left of the UI apparently, does not save it either. The two times I have resorted to macros over hand written VBA, the macro was being assigned to a CommandButton. During the real time instance of the UI the macro would be functional. But closing ( after compact/repair and backup ) and upon re-opening the project, the macro would no longer work.

Not being real familiar, as yet, with Access 2k+7 and not seeing a [ Macro ] option in the object pane, I am not certain anything is being saved/embedded ...
 
attachment.php
 

Attachments

  • eventprocs.png
    eventprocs.png
    14.6 KB · Views: 836
Thanks Bob.

It isn't/wasn't checked
 
Hi Doco,

I miss the scenery of Central Oregon and the four seasons.

Let's start with something simple and work our way up to see if we can isolate the problem (and to see if I can repro the issue in house.)

I'd like to try creating, saving, and running a simple macro object in the ADP file with Access 2007.

1. Close any open objects
2. Click the Create ribbon tab
3. In the Other group, click the down arrow on the very far right item. This drop-down menu lists three things - Macro, Module, or Class Module. The icon and name displayed on this button will be of the last type you created. For example, if you created a module, the button above the arrow will say Module.
4. Click that drop-down arrow and then click Macro from the drop-down list to start creating a new macro object.
5. In the Macro Design window, select the MsgBox action, provide the arguments, and then click the Save button on the Quick Access Toolbar. Provide a name when prompted.
6. Close the macro window.
7. Do you see this new macro object listed in the Navigation Pane? If so, what happens when you double-click on it? Does it fire and display your message?
8. Close the ADP file, re-open the file, and then redo step 7. Is it still there? Does it still run?

Let me know how that goes first.

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 
Hmmm... :o

Worked like a charm. Wonder why it would not work when created from the Property Sheet | Event | OnClick | Choose Builder | Macro Builder wizard? When creation from there - there is no option to save, etc.

But anyway, it worked great. Going through the steps you provided. Maybe someday I will get the hang of the Ribbon paradigm and remember where stuff is.

Thanks Jeff!
 
Hi Doco,

I'm still concerned about the embedded macro issue.

Can you try these simple steps for me?

1. Open your 2007 ADP file
2. Open one of your existing forms in Design view
3. Drop a new command button onto the form surface and dismiss the wizard if it comes up
4. On the Property Sheet, click the Build button next to the OnClick property for this new command button
5. You should see a small dialog pop up that asks for three choices - Macro Builder, Expression Builder, or Code Builder. Select Macro Builder and then click OK.
6. You'll see a macro design window open, but since it is an embedded macro, the window will be modal.
7. Select the MsgBox action like you did in the previous test and give it some arguments.
8. On the Ribbon, you'll see a Close button in the Close group. Click that button. Does Access prompt you to save the macro changes at this point?
9. Click Yes if you're prompted to save.
10. Save the changes to the form, switch to Form view, and then click the button. Do you see your message appear?
11. Close the database, reopen it, reopen the form, and then click the button again. Do you see your message appear again or no?

Thanks for letting me know the results.

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 
Now this is :o .

It works. I even tried retracing my original steps for the buttons I finally hand wrote VB to get to work. The macro (process) from the build button/wizard works now. :confused:

Don't know what has changed. I fussed with it numerous time before posting. But it works now [ whiskey, tango, foxtrot - over?]

I was creating the app on a remote server located in Bend via RDP from Fossil. But I don't know that that would make any difference. At any rate, I guess I can only screw up when I don't want to ;-)

Thanks again Jeff.
 
Hi Doco,

That's good to hear everything appears to be working for you now. It's definitely odd that it wasn't working before, but now it is. Such is life when we play with 1's and 0's all day long.

My guess would be it was sun spots for this one, yeah, must have been sun spots. :)

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 

Users who are viewing this thread

Back
Top Bottom