Need a message box when a field is entered

  • Thread starter lambertsm via AccessMonster.com
  • Start date
L

lambertsm via AccessMonster.com

I have a few fields on one of my forms where I want a message box to pop up
if a user enters that field to try and edit it. (They can edit it – I just
want to give some extra info on that field.) I thought programming a message
box as an event procedure for the “On enter†property (for the particular
field) would work nicely for this and it does work if you are already in the
form. But it also pops up when you enter the form itself. Thought maybe it
was because it was the first field in the form. Nope. Then I thought maybe
it was because it was the first field in the select statement for the form.
Not that it either. Gave up on “on enter†and tried “on got focus†instead
with the exact same results. “On Change†kind of gets me what I want in
that at least the pop-up only happens when you are in the field but the
message pops up with every new keystroke in the field. Pretty annoying.

Am I doing something wrong? How do I get a message box to come up when a
user goes to a particular field in a form, without having that same message
box appear when the form opens? I checked my form properties and nothing is
in “On enter†or “On Got Focusâ€.
 
B

Bernie

Use the property 'on exit' yet problem here is that if you enter nothing, it
displays the message. Alternatively, write a routine and compare field before
entry and after entry and if changed then display message.

Does this help you?
 
S

Steve Schapel

Lambertsm,

I would say that you got it right the first time - the Enter event of
the control (note: forms do not have fields) is the correct choice. I
cannot explain why you are getting the message when you open the form.
The Enter event of the first control in the form's Tab Order does fire
when the form is opened... but then you said you had already checked
that this does not apply. Just to double-check, though, can you set the
Tab Stop property of the control to No, and then try again.

Other events to check would be these event properties of the Form itself:
On Current
On Activate
On Load
On Open
 
L

lambertsm via AccessMonster.com

Comparing before and after was actually my first thought – but I didn’t know
how to capture the data in the control before and then save it to compare to
the after. I think I’ve solved this particular problem using other info.
Thanks for your help!
 
L

lambertsm via AccessMonster.com

When I put the tab stop in that was indeed the problem. So I guess I did
have it as first. Now I am reading all about tab order – something I hadn’t
even thought of until now. . . Thanks for your help!
 
L

Linq Adams via AccessMonster.com

We really need to see the sub/code that you're using. As has been said,
GotFocus and OnEnter should both work for this, and it should only trigger
when the form opens if the control is the first to get focus. Note that the
tab order of controls doesn't necessarily show the order that focus is
received!

If the tab order is

Control1
Control2
Control3

but Control1 and Control2 have Locked = Yes and Enabled = No, Control3, third
in the tab order, will be the first to receive focus when the form opens!



I would say that you got it right the first time - the Enter event of
the control (note: forms do not have fields) is the correct choice. I
cannot explain why you are getting the message when you open the form.
The Enter event of the first control in the form's Tab Order does fire
when the form is opened... but then you said you had already checked
that this does not apply. Just to double-check, though, can you set the
Tab Stop property of the control to No, and then try again.

Other events to check would be these event properties of the Form itself:
On Current
On Activate
On Load
On Open
I have a few fields on one of my forms where I want a message box to pop up
if a user enters that field to try and edit it. (They can edit it – I just
[quoted text clipped - 13 lines]
box appear when the form opens? I checked my form properties and nothing is
in “On enter†or “On Got Focusâ€.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top