dbTalk Databases Forums  

returning the focus from a tab control

comp.databases.ms-access comp.databases.ms-access


Discuss returning the focus from a tab control in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rdpacer@yahoo.com
 
Posts: n/a

Default returning the focus from a tab control - 11-14-2007 , 03:41 PM






I have a form where on current, it evaluates some fields to determine
which page on a tab control should be displayed and which should be
hidden. If I cycle through the records using the navigation buttons,
the focus will remain on the "ID" field if the tab control remains on
the same page. (The ID field is not part of the tab control). Once
it reaches a record that requires a different tab to display, it takes
the cursor down to the first field in the tab control. I've attempted
to change the tab order to put the ID field first, and have tried
DoCmd.GoToControl me.ID with no success.

The biggest problem this is presenting for the users is the search
function. When they hit "find next", it is no longer focused on the
proper control.

Overall, I don't necessarily want to put the focus back on a hardcoded
control. I need it to recognize that it is no longer on the same
control and to return to the previous.

Thanks to anyone who can help out.


Reply With Quote
  #2  
Old   
Pachydermitis
 
Posts: n/a

Default Re: returning the focus from a tab control - 11-14-2007 , 07:34 PM






On Nov 14, 1:41 pm, "rdpa... (AT) yahoo (DOT) com" <rdpa... (AT) yahoo (DOT) com> wrote:
Quote:
I have a form where on current, it evaluates some fields to determine
which page on a tab control should be displayed and which should be
hidden. If I cycle through the records using the navigation buttons,
the focus will remain on the "ID" field if the tab control remains on
the same page. (The ID field is not part of the tab control). Once
it reaches a record that requires a different tab to display, it takes
the cursor down to the first field in the tab control. I've attempted
to change the tab order to put the ID field first, and have tried
DoCmd.GoToControl me.ID with no success.

The biggest problem this is presenting for the users is the search
function. When they hit "find next", it is no longer focused on the
proper control.

Overall, I don't necessarily want to put the focus back on a hardcoded
control. I need it to recognize that it is no longer on the same
control and to return to the previous.

Thanks to anyone who can help out.
I am a little tired and don't think I am completely comprehending what
you are asking.
So I will answer all the questions that seem to apply and hopefully
one will be what you are looking for.
If your control name is txtID, use me.txtID.setfocus to go to it.
In the control properties there is a tabstop field that you can set to
no if you don't want users to tab there.
In form properties you can set the tabs to cycle several things,
record, page, everything, etc.
The on keydown event is great for grabbing the enter key on one
control and applying some other function then discarding the keystroke
(docmd.cancelevent I think).
Hope one helps
P


Reply With Quote
  #3  
Old   
rdpacer@yahoo.com
 
Posts: n/a

Default Re: returning the focus from a tab control - 11-15-2007 , 11:55 AM



I'm going with the first option of me.[ID].setfocus.

This will be okay in most cases because they will most often be
searching the ID field. It would be perfect if it could recognize
that it moved to a different control and set the focus back to the
previous control.

Thanks so far.


Reply With Quote
  #4  
Old   
Pachydermitis
 
Posts: n/a

Default Re: returning the focus from a tab control - 11-26-2007 , 10:48 AM



On Nov 15, 9:55 am, "rdpa... (AT) yahoo (DOT) com" <rdpa... (AT) yahoo (DOT) com> wrote:
Quote:
I'm going with the first option of me.[ID].setfocus.

This will be okay in most cases because they will most often be
searching the ID field. It would be perfect if it could recognize
that it moved to a different control and set the focus back to the
previous control.

Thanks so far.
There are also lost focus and exit events you can use to know when the
user is leaving a control. If you want to make sure they are putting
the right data in use the before update event and set 'Cancel' equal
to true to force the user to stay in a control until it is filled
properly.
HTH
P


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.