Results 1 to 3 of 3

Thread: [RESOLVED] Exit event

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    2

    [RESOLVED] Exit event

    I have a form with multiple frames. Inside each frame there are textboxes. I want to check the contents of each checkbox as the user exits the box. If I use the exit event for a textbox then for some textboxes (the last box visited in the frame) the exit event is not called. As far as i can tell is that this is because exit is called when you change focus to objects on the same frame, but because focus is going to another frame exit is not being called (it gets called when I reenter the frame and select another textbox in the same frame). How can I get my exit event to be called?
    I have attached a screen shot of one of my frames.
    Attached Images Attached Images  
    Last edited by corolla man; Dec 1st, 2005 at 07:44 PM.

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: Exit event

    Hi corolla man, Welcome to the Forum

    In addition to the TextBox Exit validations, you could supliment by using the Frames_Exit event and check the associated TextBoxes.

    Obviously there is doubling up of the validation (as each one is checked as you pass through, but would detect the focus to a new Frame)

    To validate only those TextBox's with in a particular frame, place this in the MAIN frames Exit:
    VB Code:
    1. Private Sub Frame1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    2. Dim ctl As Control
    3.  
    4.     For Each ctl In Frame1.Controls
    5.         If TypeOf ctl Is MSForms.TextBox Then
    6.             'Validate code here
    7.             MsgBox ctl.Name
    8.         End If
    9.     Next
    10.  
    11. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    2

    Re: Exit event

    Thanks for your reply bruce
    I ended up replacing the frames with images of a rectange which looks like a frame. This way I didnt need to double up.

    Thanks again
    Steve

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