PC Review


Reply
Thread Tools Rate Thread

Convert macros to Visual basic

 
 
=?Utf-8?B?S2lt?=
Guest
Posts: n/a
 
      10th Dec 2006
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGFuaWVs?=
Guest
Posts: n/a
 
      10th Dec 2006
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




"Kim" wrote:

> 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

 
Reply With Quote
 
=?Utf-8?B?S2lt?=
Guest
Posts: n/a
 
      10th Dec 2006
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

"Daniel" wrote:

> 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
>
>
>
>
> "Kim" wrote:
>
> > 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SOLVED! In Access 2010, Convert Macros to Visual Basic is Grayed Out Wayne Microsoft Access 0 7th Sep 2011 12:28 AM
Convert form's macros to visual basic anthony Microsoft Access Forms 0 2nd Oct 2010 05:43 PM
Macros Visual Basic santacatharina Windows XP 0 15th Dec 2008 05:12 AM
Visual Basic - Macros =?Utf-8?B?S2FuZ2E=?= Microsoft Excel Programming 2 12th Jul 2005 09:27 AM
Missing "Convert Macros to Visual Basic" function Charles L. Phillips Microsoft Access 2 21st Mar 2004 07:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:46 PM.