Form Controls

R

RichardCheshire

I am using VBA 6.3 and Excel 2000 (SP3). I have a form with many text
controls and I would like to know which control has focus. I know that in VB
it is dead easy, but in VBA I am stuck. I have a feeling it can be done thro
an API call but I can't figure how to do it. Any help would be appreciated.
 
K

Karl E. Peterson

RichardCheshire said:
I am using VBA 6.3 and Excel 2000 (SP3). I have a form with many text
controls and I would like to know which control has focus. I know
that in VB it is dead easy, but in VBA I am stuck.

Is the UserForm's ActiveControl property not giving you what you need?
I have a feeling it can be done thro an API call but I can't figure
how to do it. Any help would be appreciated.

Most controls in VBA are now lightweight -- windowless -- so APIs aren't very helpful
for this (anymore).
 
R

RichardCheshire

Thanks Karl, you have confirmed my thoughts - I knew I should have done this
project in VB!
 
K

Karl E. Peterson

Hi Richard --
Thanks Karl, you have confirmed my thoughts - I knew I should have
done this project in VB!

I understand that desire, from one perspective, but am perplexed from another...

Why doesn't ActiveControl give you what you need? Is it focus shift notification
that you're looking for? Each control has Enter and Exit events, right?

But this is a bummer, I agree there!

Later... Karl
 

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