DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Allison Guest

    Clearing contents of textbox which has the focus -(VBA EXCEL)


    Could anyone tell me how I would determine which text box currently has the
    focus, so that I can clear its contents when a commmand button is clicked?

    Thanks a bunch,
    Allison

  2. #2
    Craig Brown Guest

    Re: Clearing contents of textbox which has the focus -(VBA EXCEL)


    Allison,

    As soon as you click the button, the textbox will have lost the focus.

    I would create a string variable. Each time any textbox loses focus, set
    the string variable to the name of the textbox losing focus. In other words,
    you will need to code every textbox's lostfocus event... When you click
    the button, clear the contents of the textbox saved in the string variable.

    Craig Brown

    "Allison" <amilborrow@expressvu.com> wrote:
    >
    >Could anyone tell me how I would determine which text box currently has

    the
    >focus, so that I can clear its contents when a commmand button is clicked?
    >
    >Thanks a bunch,
    >Allison



  3. #3
    Allison Guest

    Re: Clearing contents of textbox which has the focus -(VBA EXCEL)


    Thank you for your help I just realized the error in my logic as well! Thank
    you for pointing that out to me.


    "Craig Brown" <cbrown.consulting@snet.net> wrote:
    >
    >Allison,
    >
    >As soon as you click the button, the textbox will have lost the focus.


    >
    >I would create a string variable. Each time any textbox loses focus, set
    >the string variable to the name of the textbox losing focus. In other words,
    >you will need to code every textbox's lostfocus event... When you click
    >the button, clear the contents of the textbox saved in the string variable.
    >
    >Craig Brown
    >
    >"Allison" <amilborrow@expressvu.com> wrote:
    >>
    >>Could anyone tell me how I would determine which text box currently has

    >the
    >>focus, so that I can clear its contents when a commmand button is clicked?
    >>
    >>Thanks a bunch,
    >>Allison

    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links