Results 1 to 4 of 4

Thread: Keeping up with last textbox (RESOLVED)

  1. #1

    Thread Starter
    Addicted Member GSIV's Avatar
    Join Date
    Jun 2002
    Location
    Texas, USA
    Posts
    213

    Question Keeping up with last textbox (RESOLVED)

    I've searched the forums and haven't come up with anything...

    I have a form with 5 textboxes and a control button for exiting by way of Form_QueryUnload. If the exit is cancelled, what is the best way to return to the last textbox that had focus?

    I was thinking about assigning a variable to keep up with this when the textbox loses focus, but thought there might be a simpler way.
    Last edited by GSIV; Mar 4th, 2003 at 09:15 PM.

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Variable is the easiest way to accomplish...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  3. #3
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    VB Code:
    1. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    2.     MsgBox Me.ActiveControl.Name
    3. End Sub
    But it will only work as long as you don't have a command that unloads the form. If you have one... the last ActiveControl would be this command.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  4. #4

    Thread Starter
    Addicted Member GSIV's Avatar
    Join Date
    Jun 2002
    Location
    Texas, USA
    Posts
    213
    Thanks guys!

    Wow, what a quick response.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width