Convert macros to Visual basic

K

Kim

When I ran the performance analyzer in my database it suggested I convert my
macros to visual basic. No problem, converted them, but since this is the
first time I've done it, now I'm stumped. This is the code from one of my
forms and I can't figure out how to use Visual Basic instead of the macros.
Can anybody help? thanks in advance.

Kim

Private Sub cmdFindQuote_Click()
Select Case Me.MyOptionGroup
Case 1
DoCmd.RunMacro "Macro1", 1
DoCmd.Close acForm, "Form1", acDefault

Case 2
DoCmd.RunMacro "Macro2", 1
DoCmd.Close acForm, "Form1", acDefault
Case 3
DoCmd.RunMacro "Macro3", 1
DoCmd.Close acForm, "Form1", acDefault
End Select

End Sub
 
D

Daniel

Kim,

You have to give us some more details so we can help you. According to the
code below you seem to have 3 different Macros (Macro1,2 and 3). Thus, you
need to convert each of them into VBA code. We can help but you are going to
have to supply to information about each macro. What does each do (open a
report, pop-up amenu...)...etc. then we can help you get the code to replace
them. try to give as much info as possible.

Daniel
 
K

Kim

Thanks Daniel, no problem. The event is on the OnClick procedure of a pop up
form that allows the user to search by 3 things. Each macro opens the same
form, but finds the specific info from the pop up form (Macro1 - Name, Macro
2 - Address, Macro 3 - Number). Did that help?

Kim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top