Results 1 to 5 of 5

Thread: Help

  1. #1
    Join Date
    Sep 2002
    Location
    california
    Posts
    31

    Unanswered: Help

    I have a main form with a tab control. Each page of the tab control has a subform on it. When I click a tab I want the subform to have the first field selected, not where I was when I clicked to another page. I tried setting the focus to the field, I tried a select case for the change property of the tab control... nothing works all the time. The wrench in this is that when I tab out of the last field on each subform I set the focus to the first field on the next tab... that works. but if the user leaves the cursor in the last field on a subform and uses his mouse to click on the tab control to go to another page... when the user returns to the page where he left his cursor and then clicks anywhere else on that page, the event works and it jumps to the first field on the next page.
    I have worked on this for days and been searching this site and the archieves to no avail. Maybe it's impossible.

    PS I've also tried using the exit and lost focus events and keypress... the keypress will read a tab and go to the next page.. actually keypress works pretty well except that even though it's an event on the last field... if I tab into that field, that last field is skippeed complete (don't get a chance to type or tab) and it jumps to first field on next subform.

  2. #2
    Join Date
    May 2002
    Location
    London
    Posts
    87
    Would

    Me.ctlSubForm.Requery
    Me.ctlSubForm.SetFocus

    work? Of course you may not want to requery in which case I can't think how to approach it.

  3. #3
    Join Date
    Sep 2002
    Location
    california
    Posts
    31

    Smile

    Originally posted by Risky
    Would

    Me.ctlSubForm.Requery
    Me.ctlSubForm.SetFocus

    work? Of course you may not want to requery in which case I can't think how to approach it.
    Thanks for the try but I tried that also.... I think I tried just about everything out there. What I have finally decided to to is put a button on each subform on each tab... the button will be last in the tab order and when clicked will take the user to the next page, so when/if the user returns to any page, clicking in a field will not activate the lost focus/exit I had on the last field and jump to the next one. I can't think of a reason for this not to work... in fact it will give the user more flexiblity in that if they don't click the button then can tab back thru the subform and make changes. Hopefully the boss will be ok with it.

    Thanks so much for your reply.
    Debbie

  4. #4
    Join Date
    Jul 2003
    Posts
    48

    Re: Help

    You could put a message box in each form event to do with loading/viewing, i.e.

    Form_Activate(),
    Form_Load(),
    Form_Click(),
    Form_Close(),
    Form_Current(),
    Form_Deactivate(),
    Form_GotFocus(), etc

    This will show you what event fires everytime when switching between tabs

  5. #5
    Join Date
    Sep 2002
    Location
    california
    Posts
    31

    Smile Re: Help

    Originally posted by bscorer
    You could put a message box in each form event to do with loading/viewing, i.e.

    Form_Activate(),
    Form_Load(),
    Form_Click(),
    Form_Close(),
    Form_Current(),
    Form_Deactivate(),
    Form_GotFocus(), etc

    This will show you what event fires everytime when switching between tabs
    This is a great idea! It would help me learn when these events are actually happening and much faster then my hunt and peck approach. I am sure that I will have many opportunities to use this info. Thanks.

Posting Permissions

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