[AccessD] moving focus off the tab page

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Tue Jul 20 12:56:52 CDT 2004


John:

At first I thought you were trying to solve this for a specific form where
you knew the controls and you knew where you wanted the focus set.  But
you're trying to make a general case routine?  Would using
Screen.currrentControl help figure out where you are?

Rocky

----- Original Message ----- 
From: "Colby, John" <JColby at dispec.com>
To: "'Access Developers discussion and problem solving'"
<accessd at databaseadvisors.com>
Sent: Tuesday, July 20, 2004 9:08 AM
Subject: RE: [AccessD] moving focus off the tab page


> Rocky,
>
> The question is "what is the desired control to set the focus in", NOT how
> to set the focus.
>
> In any form, there is no single "tab index 0" control.  If you have a
header
> with controls in it, there will be one there.  If you have a footer with
> controls, there will be one there.  There will be one in the main part of
> the form.  Furthermore, if you have tab controls, EACH page of the tab
> control has it's own tab order etc.  So.. if I am in the header and tap
the
> tab key I go one place, if I am in the footer and tap the tab key I go
> another, if I am in the main part of the form I go a third, if I am in
page1
> of the tab control I go another, if I am in page 2 of the form I go
> another.....  WHICH CONTROL WILL RECEIVE THE FOCUS IF I TAP THE TAB KEY?
>
> To complicate matters further, just because a control has tab index set to
0
> doesn't mean it can get the focus.  It may be invisible, it may be
disabled,
> or it may simply have it's property that allows it to be "tabbed into" set
> to false.  My question is...
>
> How do I determine WHICH control would get the focus if the tab key were
> tapped?  The answer varies depending on whether there are tabs (if so
which
> tab is currently selected?), whether the current focus is in the header /
> footer / body of the form, etc.  UGLY question, and Access is no help at
all
> determining the answer (AFAICT).
>
> This is one of those "the stupid bastards know the answer" (the tab key
> works doesn't it?) but they don't expose the answer to me so I can set the
> focus to that control using SomeControl.SetFocus syntax.
>
> JWC.
>
> -----Original Message-----
> From: Rocky Smolin - Beach Access Software [mailto:bchacc at san.rr.com]
> Sent: Tuesday, July 20, 2004 11:34 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] moving focus off the tab page
>
>
> John:
>
> Why can't you use the _Open event of the form to se the focus to the
desired
> control?
>
> Rocky
>
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list