PC Review


Reply
Thread Tools Rate Thread

Alternative to &Caption for a button in VBA

 
 
itsyash@gmail.com
Guest
Posts: n/a
 
      13th Jun 2007
Hi All,

I am trying to change the caption of a button in VBA to &Submit. If i
did this in VB then i would get an underline below the letter S in
"Submit" which would make it a shortcut. However, in VBA it shows
&Sumit as the caption.

Can some one pls guide me on how to do this VBA.

Thanks in advance,
Yash

 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      13th Jun 2007
Yash,
Check out the .Accelerator property.

NickHK

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All,
>
> I am trying to change the caption of a button in VBA to &Submit. If i
> did this in VB then i would get an underline below the letter S in
> "Submit" which would make it a shortcut. However, in VBA it shows
> &Sumit as the caption.
>
> Can some one pls guide me on how to do this VBA.
>
> Thanks in advance,
> Yash
>



 
Reply With Quote
 
itsyash@gmail.com
Guest
Posts: n/a
 
      13th Jun 2007
Hi Nick

Tried this.. no go...can you plz explain..

Yash

On Jun 13, 3:17 pm, "NickHK" <TungChe...@Invalid.com> wrote:
> Yash,
> Check out the .Accelerator property.
>
> NickHK
>
> <itsy...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > Hi All,

>
> > I am trying to change the caption of a button in VBA to &Submit. If i
> > did this in VB then i would get an underline below the letter S in
> > "Submit" which would make it a shortcut. However, in VBA it shows
> > &Sumit as the caption.

>
> > Can some one pls guide me on how to do this VBA.

>
> > Thanks in advance,
> > Yash- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      13th Jun 2007
Maybe you can explain what you mean by "no go" ?
I cannot see what you have done.

NickHK

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Nick
>
> Tried this.. no go...can you plz explain..
>
> Yash
>
> On Jun 13, 3:17 pm, "NickHK" <TungChe...@Invalid.com> wrote:
> > Yash,
> > Check out the .Accelerator property.
> >
> > NickHK
> >
> > <itsy...@gmail.com> wrote in message
> >
> > news:(E-Mail Removed)...
> >
> >
> >
> > > Hi All,

> >
> > > I am trying to change the caption of a button in VBA to &Submit. If i
> > > did this in VB then i would get an underline below the letter S in
> > > "Submit" which would make it a shortcut. However, in VBA it shows
> > > &Sumit as the caption.

> >
> > > Can some one pls guide me on how to do this VBA.

> >
> > > Thanks in advance,
> > > Yash- Hide quoted text -

> >
> > - Show quoted text -

>
>



 
Reply With Quote
 
itsyash@gmail.com
Guest
Posts: n/a
 
      13th Jun 2007
when i type "&Submit" in the caption property of the button, it shows
the text as it is and does nothing if i press alt+S. If it was VB it
would have fired the submit button.

What exactly do i have to to with the .accelerator property to get
this working?

Yash

On Jun 13, 3:28 pm, "NickHK" <TungChe...@Invalid.com> wrote:
> Maybe you can explain what you mean by "no go" ?
> I cannot see what you have done.
>
> NickHK
>
> <itsy...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > Hi Nick

>
> > Tried this.. no go...can you plz explain..

>
> > Yash

>
> > On Jun 13, 3:17 pm, "NickHK" <TungChe...@Invalid.com> wrote:
> > > Yash,
> > > Check out the .Accelerator property.

>
> > > NickHK

>
> > > <itsy...@gmail.com> wrote in message

>
> > >news:(E-Mail Removed)...

>
> > > > Hi All,

>
> > > > I am trying to change the caption of a button in VBA to &Submit. If i
> > > > did this in VB then i would get an underline below the letter S in
> > > > "Submit" which would make it a shortcut. However, in VBA it shows
> > > > &Sumit as the caption.

>
> > > > Can some one pls guide me on how to do this VBA.

>
> > > > Thanks in advance,
> > > > Yash- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      13th Jun 2007
Unlike VB(6), in VBA userforms most controls an 'Accelerator' property.
Select your button, press F4 and look in properties.

Type simply 'S' without the & in the property. This will allow user to Alt-S
to your button. Also unlike VB, the accelerator key does not need to exist
in the caption, though if it does it will be underlined.

Regards,
Peter T

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> when i type "&Submit" in the caption property of the button, it shows
> the text as it is and does nothing if i press alt+S. If it was VB it
> would have fired the submit button.
>
> What exactly do i have to to with the .accelerator property to get
> this working?
>
> Yash
>
> On Jun 13, 3:28 pm, "NickHK" <TungChe...@Invalid.com> wrote:
> > Maybe you can explain what you mean by "no go" ?
> > I cannot see what you have done.
> >
> > NickHK
> >
> > <itsy...@gmail.com> wrote in message
> >
> > news:(E-Mail Removed)...
> >
> >
> >
> > > Hi Nick

> >
> > > Tried this.. no go...can you plz explain..

> >
> > > Yash

> >
> > > On Jun 13, 3:17 pm, "NickHK" <TungChe...@Invalid.com> wrote:
> > > > Yash,
> > > > Check out the .Accelerator property.

> >
> > > > NickHK

> >
> > > > <itsy...@gmail.com> wrote in message

> >
> > > >news:(E-Mail Removed)...

> >
> > > > > Hi All,

> >
> > > > > I am trying to change the caption of a button in VBA to &Submit.

If i
> > > > > did this in VB then i would get an underline below the letter S in
> > > > > "Submit" which would make it a shortcut. However, in VBA it shows
> > > > > &Sumit as the caption.

> >
> > > > > Can some one pls guide me on how to do this VBA.

> >
> > > > > Thanks in advance,
> > > > > Yash- Hide quoted text -

> >
> > > > - Show quoted text -- Hide quoted text -

> >
> > - Show quoted text -

>
>



 
Reply With Quote
 
itsyash@gmail.com
Guest
Posts: n/a
 
      13th Jun 2007
On Jun 13, 4:20 pm, "Peter T" <peter_t@discussions> wrote:
> Unlike VB(6), in VBA userforms most controls an 'Accelerator' property.
> Select your button, press F4 and look in properties.
>
> Type simply 'S' without the & in the property. This will allow user to Alt-S
> to your button. Also unlike VB, the accelerator key does not need to exist
> in the caption, though if it does it will be underlined.
>
> Regards,
> Peter T
>
> <itsy...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > when i type "&Submit" in the caption property of the button, it shows
> > the text as it is and does nothing if i press alt+S. If it was VB it
> > would have fired the submit button.

>
> > What exactly do i have to to with the .accelerator property to get
> > this working?

>
> > Yash

>
> > On Jun 13, 3:28 pm, "NickHK" <TungChe...@Invalid.com> wrote:
> > > Maybe you can explain what you mean by "no go" ?
> > > I cannot see what you have done.

>
> > > NickHK

>
> > > <itsy...@gmail.com> wrote in message

>
> > >news:(E-Mail Removed)...

>
> > > > Hi Nick

>
> > > > Tried this.. no go...can you plz explain..

>
> > > > Yash

>
> > > > On Jun 13, 3:17 pm, "NickHK" <TungChe...@Invalid.com> wrote:
> > > > > Yash,
> > > > > Check out the .Accelerator property.

>
> > > > > NickHK

>
> > > > > <itsy...@gmail.com> wrote in message

>
> > > > >news:(E-Mail Removed)...

>
> > > > > > Hi All,

>
> > > > > > I am trying to change the caption of a button in VBA to &Submit.

> If i
> > > > > > did this in VB then i would get an underline below the letter S in
> > > > > > "Submit" which would make it a shortcut. However, in VBA it shows
> > > > > > &Sumit as the caption.

>
> > > > > > Can some one pls guide me on how to do this VBA.

>
> > > > > > Thanks in advance,
> > > > > > Yash- Hide quoted text -

>
> > > > > - Show quoted text -- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


Thanks Peter,

That worked...However, the accelerator is in the caption as well, but
still does not show an underline. The drawback is that users wont
understand that there is a short cut.

Yash

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      13th Jun 2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Jun 13, 4:20 pm, "Peter T" <peter_t@discussions> wrote:
> > Unlike VB(6), in VBA userforms most controls an 'Accelerator' property.
> > Select your button, press F4 and look in properties.
> >
> > Type simply 'S' without the & in the property. This will allow user to

Alt-S
> > to your button. Also unlike VB, the accelerator key does not need to

exist
> > in the caption, though if it does it will be underlined.
> >
> > Regards,
> > Peter T

<snip>
> Thanks Peter,
>
> That worked...However, the accelerator is in the caption as well, but
> still does not show an underline. The drawback is that users wont
> understand that there is a short cut.
>
> Yash


Does the underline appear if you press Alt

Depending on your Windows version try looking at -

Display properties, Appearance, Effects and the 'Hide underlined keys...'
option.

Regards,
Peter T



 
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
Button Caption help Jim Brooks Microsoft Access Getting Started 3 6th Feb 2010 12:18 PM
Set Button Caption Nigel Microsoft Excel Programming 1 2nd Feb 2009 09:58 PM
Created custom caption bar - need help with caption button positio =?Utf-8?B?TWFyaXVzSQ==?= Microsoft Dot NET Framework Forms 0 28th Jun 2005 08:21 AM
Button Caption? MJJ Microsoft Access 1 6th Jun 2004 01:49 AM
Caption of a button Dr_Phil Microsoft Excel Programming 4 4th May 2004 09:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 AM.