Kamis, 09 Agustus 2012

RE: [MS_AccessPros] Subform LOST FOCUS help

 

Hi Paul

You would place the code in the same places where you are currently hiding
and redisplaying the subform.

In other words, the code to conditionally set focus to the "parking" control
goes in lblCriticality_MouseMove, just before you hide the subform, and the
code to conditionally set focus back to the subform goes in
Detail_MouseMove, just after you display the subform.

It really doesn't matter whether you use a transparent command button or a
textbox to "park" the focus. I prefer the command button because it is
absolutely invisible, while a textbox - even one with zero size - is not.

Good luck! :-)
Graham

> From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of paulc8481
> Sent: Friday, 10 August 2012 02:21
> To: MS_Access_Professionals@yahoogroups.com
> Subject: Re: [MS_AccessPros] Subform LOST FOCUS help
>
>  
> Graham, Glenn,
> I still a bit "green" when it comes to creating these databases with VBA
so please bare with me.
> When placing this code, would it be implemented within the criticality
mouse move function or within the forms details mouse move function?
>
> Thanks
>
> Paul
>
> --- In MS_Access_Professionals@yahoogroups.com, "Glenn Lloyd"
<argeedblu@...> wrote:
> >
> > Further to what Graham has suggested, I create a textbox (usually named
> > txtDummy) with a height and width of 0 and position it at 0,0 is one of
the
> > form's section for this purpose. The dummy textbox should also not be a
tab
> > stop.
> >
> >
> >
> > Glenn
> >
> >
> >
> > From: MS_Access_Professionals@yahoogroups.com
> > [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Graham
Mandeno
> > Sent: August-08-12 10:55 PM
> > To: MS_Access_Professionals@yahoogroups.com
> > Subject: RE: [MS_AccessPros] Subform LOST FOCUS help
> >
> >
> >
> >
> >
> > Hi Paul
> >
> > The trick is to test if the control you want to hide is the active
control
> > and, if so, set the focus somewhere else before you make it invisible
(or
> > disable it).
> >
> > Something like this:
> >
> > If Me.ActiveControl.Name = "SubformControlName" Then
> > Me("SomeOtherControl").SetFocus
> > Me("SubformControlName").Visible = False
> >
> > To be a bit more fancy, you could use a tiny transparent command button
> > named "cmdPark" to take the focus. Then, when the mouse rolls off and
you
> > restore the visibility of the subform, you can check if you are on that
> > button and set focus back to the subform:
> >
> > If Me.ActiveControl.Name = "cmdPark" Then Me("SubformControlName
").SetFocus
> >
> > Make sure cmdPark has TabStop set to "No".
> >
> > Good luck! :-)
> > Graham

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar