By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,039 Members | 1,824 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,039 IT Pros & Developers. It's quick & easy.

Need to supress a open form command if the fieldto getting focus is [field1]

P: n/a
Hi,
I need some help here. I have a On Exit procedure on [items] that
opens a form. Whenever anyone clicks anything outside of it the form
opens.
No problem here.
But I need it not to open if the selected command is command317.
Both items and command 317 are on the first form from wich the second
one opens from. I would love any input.
T

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In your OnExit:

If Not (Screen.PreviousControl.Name = "command317") Then
DoCmd.OpenForm "TheFormIWantToOpenWhenIClickOutsideTheTextBox "
Darryl Kerkeslager

PS: You may want to look at the Access Naming Conventions. It will make
your posts more decipherable.

http://msdn.microsoft.com/archive/de...n_20naming.asp
"Mr. T" <ti*********@hotmail.com> wrote:
I need some help here. I have a On Exit procedure on [items] that
opens a form. Whenever anyone clicks anything outside of it the form
opens.
No problem here.
But I need it not to open if the selected command is command317.
Both items and command 317 are on the first form from wich the second
one opens from. I would love any input.

Nov 13 '05 #2

P: n/a
Thanks for the post
I think I misstated a fact actually I am in [items] and goin to any
other control or field. But I want the form not to pop up if they
clicked on [command317] wich forced the "items on exit command". So
actually the focus has never actually got to command 317. The focus
would be there if I had not interupted. But I need the form to pop up
every time the field [items] is exited except if a person selected
command 317 to exit.
Thanks T

Nov 13 '05 #3

P: n/a
Mr. T wrote:
Thanks for the post
I think I misstated a fact actually I am in [items] and goin to any
other control or field. But I want the form not to pop up if they
clicked on [command317] wich forced the "items on exit command". So
actually the focus has never actually got to command 317. The focus
would be there if I had not interupted. But I need the form to pop up
every time the field [items] is exited except if a person selected
command 317 to exit.
Thanks T


Then you need to use a different event. Perhaps a common function can be called
in the GotFocus of all controls except for the one command button.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #4

P: n/a
Ya thanks.
Is there a global got focus command or would it have to be inserted to
every field and command? And actually the main thing I was wondering
was if there was a property similar to:
screen.PreviousControl.Name
but instead for NextContol.name

But a global on GotFocus command would work.
Having to do it for every control and field would not be efficient.

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.