View Full Version : Run macro from combo list


Tareq_1993
12-02-2009, 01:19 AM
Hello Everyone :)

Please, I need to know the way, how to activate the macro by clicking on a choice from choices in the drop box? I've seen one in read templates of Office 2007, but I dun know how to make one like it.

I am using Access 2007

Please help me.

Yours, Tareq

wiklendt
12-06-2009, 04:11 PM
you're probably better off using VBA in the after update event of the combo - VBA is much more flexible than macros, although this does depend on what you want the selection of the combo to do.

the basic code would look like the example in this link (scroll down past the ads):

http://www.blueclaw-db.com/select_case.htm

ajetrumpet
12-06-2009, 07:58 PM
Yours, Tareq

first of all, let me say that I'm flattered that I'm "yours". Thanks, but I'm not looking right now.

and if wik's solution takes a back burner for some reason, know that you can query systems tables to get the names of every report, form, or macro, etc... in the database. Then, use that combo value to run the macro after you choose it by name. for example:docmd.runmacro me.combobox