Run macro from combobox NOT based on selection

hawg1

Registered User.
Local time
Today, 10:39
Joined
Sep 24, 2006
Messages
51
Hi,

Is it possible to call/run a macro from a combobox but it is NOT based on the combobox selection?

I know you can do it based on the combobox selection but that is not what I want. I have the user make a selection from the combobox and store it as a variable under the afterupdate event criteria. Within that same afterupdate event, I want to close the form and run a macro that will allow the user to select a file using the API command dialog box.

I have the command dialog box macro runnig fine and can call it from a button with no problem. Just need to be able to call it from within a combo box.

Any Ideas/suggestions
 
Code:
Private Sub Combo1_AfterUpdate()
   SomePublicVariable = Me.Combo1
   DoCmd.Close acForm, "NameOfForm"
   DoCmd.RunMacro "NameOfMacro"
End Sub

Would this do

JR
 
Thanks. That worked out fine, don't know why I didn't think of that right away. Must be tired.
 

Users who are viewing this thread

Back
Top Bottom