Results 1 to 5 of 5

Thread: Making a text box do something when exited?

  1. #1

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Hi,
    How do make a text box run a program when that text box is exited with a tab or mouse click?

    For example:
    Text1 = "Enter Part Number"
    Text2 = "Enter Description"
    Text3 = "Enter Quantity Received"

    Text2 could be automatically populated from the database if the program looked at the database when Text1 is exited.

    I don't need to know how to grab data from the database. This I can do.

    Thanks,
    Al.


    ------------------
    A computer is a tool, not a toy.
    <A HREF="mailto:[email protected]
    [email protected]">[email protected]
    [email protected]</A>


  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Put your code in the LostFocus event of the text box. It gets fired if the user uses the mouse to click something else, and if TAB is used, infact any method of moving focus to something else will fire the event.

    Regards,

    [This message has been edited by chrisjk (edited 01-24-2000).]

  3. #3

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Ok?
    I know of GotFocus and LostFocus but I don't know how to use them. My text boxes default to Text1_Change().

    I tried:
    If Text1.LostFocus = True then... but, probably obvious to you, this didn't work.

    How does one use GotFocus or LostFocus?

    Thanks,
    Al.



    ------------------
    A computer is a tool, not a toy.
    <A HREF="mailto:[email protected]
    [email protected]">[email protected]
    [email protected]</A>


  4. #4
    Member
    Join Date
    Jul 1999
    Location
    J-ville, NC
    Posts
    54

    Post

    Each of those are event procedures....like Text1_Change

    Just switch to that event and place your code in there.

    ------------------
    David Underwood
    Cannabatech Corporation

    ICQ - 14028049
    E-mail - [email protected]




  5. #5
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    here:
    Code:
    Private Sub Text1_LostFocus()
    text2.text = myDB
    End Sub
    Good luck,

    ------------------
    DiGiTaIErRoR


    [This message has been edited by DiGiTaIErRoR (edited 01-25-2000).]

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