PC Review


Reply
Thread Tools Rate Thread

Auto code in VBE when pressing F7

 
 
Bishop
Guest
Posts: n/a
 
      28th May 2009
When I pull up a Form and press F7 to see the code VBE will automatically add:

Sub BlahBlah_Click ()

End Sub

to the bottom of my existing code. How do I make this stop?
 
Reply With Quote
 
 
 
 
Bishop
Guest
Posts: n/a
 
      28th May 2009
Hmm... not really what I was looking for. Pressing the F7 key allows me to
stay on the keyboard. And your method requires extra steps. I notice it
doesn't do this all the time. Surely there is a way to prevent it. Why else
would it do it on some forms and not others?

"Patrick Molloy" wrote:

> simple ...don't press F7!
>
> right-click the form and select View Code, or in the VBAProject window,
> select the form and click the code icon or again right-click and select View
> code
>
> "Bishop" <(E-Mail Removed)> wrote in message
> news:ED43E408-85A0-47E3-9852-(E-Mail Removed)...
> > When I pull up a Form and press F7 to see the code VBE will automatically
> > add:
> >
> > Sub BlahBlah_Click ()
> >
> > End Sub
> >
> > to the bottom of my existing code. How do I make this stop?

>

 
Reply With Quote
 
Andy Pope
Guest
Posts: n/a
 
      28th May 2009
Hi,

Once you have the code window open you could use CTRL+TAB to return to it.

F7 on a userform will take you to an event of the active control.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bishop" <(E-Mail Removed)> wrote in message
news:ED43E408-85A0-47E3-9852-(E-Mail Removed)...
> When I pull up a Form and press F7 to see the code VBE will automatically
> add:
>
> Sub BlahBlah_Click ()
>
> End Sub
>
> to the bottom of my existing code. How do I make this stop?


 
Reply With Quote
 
Bishop
Guest
Posts: n/a
 
      28th May 2009
CTRL+Tab seems to have no discernable order. It takes me from the the code
for Form1 to Module3 to Module 7 to Form2 to code for Form3 so on and so
forth. How do I set the tab order?

"Andy Pope" wrote:

> Hi,
>
> Once you have the code window open you could use CTRL+TAB to return to it.
>
> F7 on a userform will take you to an event of the active control.
>
> Cheers
> Andy
>
> --
>
> Andy Pope, Microsoft MVP - Excel
> http://www.andypope.info
> "Bishop" <(E-Mail Removed)> wrote in message
> news:ED43E408-85A0-47E3-9852-(E-Mail Removed)...
> > When I pull up a Form and press F7 to see the code VBE will automatically
> > add:
> >
> > Sub BlahBlah_Click ()
> >
> > End Sub
> >
> > to the bottom of my existing code. How do I make this stop?

>
>

 
Reply With Quote
 
Bishop
Guest
Posts: n/a
 
      28th May 2009
If you click on the Form name in the Project Window and hit F7 it will simply
show you the code. If you click on the actual Userform and hit F7 then it
will go to the code window and auto-populate a new procedure.

"Bishop" wrote:

> When I pull up a Form and press F7 to see the code VBE will automatically add:
>
> Sub BlahBlah_Click ()
>
> End Sub
>
> to the bottom of my existing code. How do I make this stop?

 
Reply With Quote
 
Andy Pope
Guest
Posts: n/a
 
      29th May 2009
The order is the same as the order of items under the Windows menu.

So if you want keystrokes only, ALT+W followed by the number of the window
to gain focus.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bishop" <(E-Mail Removed)> wrote in message
news:7A685374-43DC-41C9-A6B2-(E-Mail Removed)...
> CTRL+Tab seems to have no discernable order. It takes me from the the
> code
> for Form1 to Module3 to Module 7 to Form2 to code for Form3 so on and so
> forth. How do I set the tab order?
>
> "Andy Pope" wrote:
>
>> Hi,
>>
>> Once you have the code window open you could use CTRL+TAB to return to
>> it.
>>
>> F7 on a userform will take you to an event of the active control.
>>
>> Cheers
>> Andy
>>
>> --
>>
>> Andy Pope, Microsoft MVP - Excel
>> http://www.andypope.info
>> "Bishop" <(E-Mail Removed)> wrote in message
>> news:ED43E408-85A0-47E3-9852-(E-Mail Removed)...
>> > When I pull up a Form and press F7 to see the code VBE will
>> > automatically
>> > add:
>> >
>> > Sub BlahBlah_Click ()
>> >
>> > End Sub
>> >
>> > to the bottom of my existing code. How do I make this stop?

>>
>>


 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      13th Jul 2009
understood. i get around this by double clicking a button or whatever that
has code written.
I agree , its a pain
- nope, I can't see how to prevent it I'm afraid

"Bishop" <(E-Mail Removed)> wrote in message
news:437D204F-83F2-45AF-B9F3-(E-Mail Removed)...
> Hmm... not really what I was looking for. Pressing the F7 key allows me
> to
> stay on the keyboard. And your method requires extra steps. I notice it
> doesn't do this all the time. Surely there is a way to prevent it. Why
> else
> would it do it on some forms and not others?
>
> "Patrick Molloy" wrote:
>
>> simple ...don't press F7!
>>
>> right-click the form and select View Code, or in the VBAProject window,
>> select the form and click the code icon or again right-click and select
>> View
>> code
>>
>> "Bishop" <(E-Mail Removed)> wrote in message
>> news:ED43E408-85A0-47E3-9852-(E-Mail Removed)...
>> > When I pull up a Form and press F7 to see the code VBE will
>> > automatically
>> > add:
>> >
>> > Sub BlahBlah_Click ()
>> >
>> > End Sub
>> >
>> > to the bottom of my existing code. How do I make this stop?

>>

 
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
Re: Auto code in VBE when pressing F7 Patrick Molloy Microsoft Excel Programming 0 28th May 2009 04:47 PM
Auto submit when pressing enter mazdotnet Microsoft ASP .NET 1 20th Aug 2007 07:39 PM
Running code when pressing the * key =?Utf-8?B?dGVycnkgdw==?= Microsoft Access Form Coding 4 31st Mar 2007 03:57 PM
possible to simulate pressing of <tab> key with VBA code? A.J.M. van Rijthoven Microsoft Access Forms 2 13th Aug 2005 02:52 PM
Pressing F4 with code in Combo Box Brenda Hoffman Microsoft Access Form Coding 2 2nd Jun 2004 04:43 PM


Features
 

Advertising
 

Newsgroups
 


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