Macros to VBA

mech55

Registered User.
Local time
Today, 10:59
Joined
Aug 26, 2005
Messages
61
I just converted a macro to VBA by saving it as a module. How do I use this module in the same way I used the macro?

Thanks, (vba newb)
 
It all depends what the macro did, and when/where it was triggered from. Need more information.
 
Normally Access should have created a Function in the module. You can refer to that function from a form just by 'calling' it...

For example: Module1 contains this

'------------------------------------------------------------
' Macro1
'
'------------------------------------------------------------
Function Macro1()
DoCmd.OpenForm "Formulier1", acNormal, "", "", , acNormal
DoCmd.Maximize
End Function

If you'd like to run this code from within another form, you could do this:
Create a button (or another control) and in the 'onClick' option you add the following program code:

Call Macro1

Hope it works!

Greetz,

Seth
 

Users who are viewing this thread

Back
Top Bottom