Re: MS Access: Force Form with Data*** To Keep Focus When User Navigates Away -Stumped-
- From: cc77lemon@xxxxxxxxx
- Date: Wed, 28 May 2008 17:54:18 -0700 (PDT)
On May 28, 11:53 pm, Salad <o...@xxxxxxxxxxx> wrote:
cc77le...@xxxxxxxxx wrote:
On May 28, 9:26 pm, Salad <o...@xxxxxxxxxxx> wrote:
cc77le...@xxxxxxxxx wrote:
Ok.
What I want to do is:
Call up form2 from a button on form1. Form2 is a data***. I don't
want the user to be able to lose focus of this form2 until the
traditionally close it with the 'x' button. Form2 must be sizeable.
It doesn't seem (haven't found a way) to make a Data*** Sizeable
Form be Modal and stay on top of all other windows until the user
closes the form by the 'x' button on the form.
Only other choice I have is to try to catch when the user tries to
take focus away from the form by clicking another area in access other
than form2.
The Form2's 'On Lost Focus' Event refuses to fire due to the nature of
how Access works (I've read).
This is because there are other controls on the form2 that could have
focus.
SO... I went to each of the controls (3 of them) on form2 and set
their 'On Lost Focus' Events.
I just need to figure out the right code to stick in those Events in
order to return (forcefully) the user back to the form2 that should
keep the focus until the 'x' button is pressed.
Any suggestions?
DoCmd.OpenForm "YourDataSheetFormName", , , , , acDialog
Vaitape I Nunuehttp://www.youtube.com/watch?v=ROBQ0SxQ_xM-Hide quoted text -
- Show quoted text -
No.. that doesn't work. If I keep the form as a FORM view, then it
works. But if I specify in the properties for the form to show as a
DATA***, it doesn't work.
I've tested this all over the place, and apparently Access does not
like to provide the modal control for the form to stay on top of
everything and KEEP the focus IF the form is in DATA*** view.
If I change it to FORM view, it works fine.
Are you wanting to resize a modal window? Not going to happen. You can
restore, minimize, or maximize on the form open event.
If I do this
DoCmd.OpenForm "FormName"
DoCmd.OpenForm "FormName", acNormal, , , , acDialog
it will not be modal
If I do this
DoCmd.OpenForm "FormName", acNormal, , , , acDialog
it is modal
If I do this
DoCmd.OpenForm "FormName", acFormDS, , , , acDialog
it is modal
If I do this
DoCmd.OpenForm "FormName", , , , , acDialog
it is modal
IOW, if the form is opened as normal and then a call is made to open it
as modal then it will not be modal. If the form is being opened and it
is not loaded it will be modal.
What I did try was this. I created a function
Private Function SelOb()
If IsLoaded("Form2") Then
MsgBox "Loaded"
DoCmd.SelectObject acForm, "Form2"
End If
End Function
Then I highlighted all of the textboxs on Form1 and then entered
=SelOb
Then when I opened Form2 and clicked back on form1 I was thrust back to
Form2
Drumminghttp://www.youtube.com/watch?v=jv_UZkuHfjY- Hide quoted text -
- Show quoted text -
Right, thanks for your reply. Apparently you're not ready my full
initial post. Or you don't understand that.
Knowing that I can't make a Form that is a Data*** as Modal (that
keeps focus no mater what and can still be resized), I'm looking for
another way to handle it.
Namely, if someone tries to click away from that Data*** Form, there
will be some type of event triggered to check if the user actually
tries to navigate away from that form. If they have, then in code,
force the focus back to the window.
Only allow the close[x] of the window.
So I'm looking for a way in code to do this.
.
- Follow-Ups:
- References:
- MS Access: Force Form with Data*** To Keep Focus When User Navigates Away -Stumped-
- From: cc77lemon
- Re: MS Access: Force Form with Data*** To Keep Focus When User Navigates Away -Stumped-
- From: Salad
- Re: MS Access: Force Form with Data*** To Keep Focus When User Navigates Away -Stumped-
- From: cc77lemon
- Re: MS Access: Force Form with Data*** To Keep Focus When User Navigates Away -Stumped-
- From: Salad
- MS Access: Force Form with Data*** To Keep Focus When User Navigates Away -Stumped-
- Prev by Date: Re: Opening Excel from Access
- Next by Date: Re: Opening Excel from Access
- Previous by thread: Re: MS Access: Force Form with Data*** To Keep Focus When User Navigates Away -Stumped-
- Next by thread: Re: MS Access: Force Form with Data*** To Keep Focus When User Navigates Away -Stumped-
- Index(es):