Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to create macros programmatically.

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I'm using Access 2010 and I want to create custom groups within the Navigation Pane (can that be done programmatically?). Each item within a group is either a shortcut for opening a form or report. However, each shortcut represents a macro that calls a function to open the forms and/or reports. For several reasons, I need to be able to create these macros programmatically.

Is there a way to programmatically create a macro?
 
???? ... ???? ...

What would the real difference be? Between a "Macro" and just (another) UDF? It is quite possible to 'write code which writes code'. The 'generated'/written code can obviously do what even any code oher code can do.

So back to WHY does it want need to end up as a macro?



MichaelRed


 
I have created library functions to open forms in various ways. For example, a call to one function will hide the current form, open the form specified, and upon closing the form the hidden form is made visible.

I want to list the forms, from which the user can choose, in custom groups within the navigation pane. For example, I might have one custom group named "LookUp Forms", which lists all of forms tied to the lookup tables. I can't simply create a shortcut for each form, because it won't open like I want it to. So I have to place a macro within the custom group that calls the function that opens the form the way I want it to be opened.

For example, the custom group is named "LookUp Forms" and the items within the group are macros that will be executed when the user selects them.

LookUp Forms
Form1
Form2
Form3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top