Warning message?

  • Thread starter Thread starter jo
  • Start date Start date
J

jo

Hi is it possible for a warning message to appear if a user tries entering
data in a field?
If a user selects the [Grinding] check box they will not need to enter data
in the [TSL M] field. But I still have some users that accidently do this. I
would like a Beep and msgbox to say "If the Grinding box has been selected,
do not enter data" Is this possible?
 
Hi is it possible for a warning message to appear if a user tries entering
data in a field?
If a user selects the [Grinding] check box they will not need to enter data
in the [TSL M] field. But I still have some users that accidently do this.. I
would like a Beep and msgbox to say "If the Grinding box has been selected,
do not enter data" Is this possible?

Jo,

In the On Enter event of [TSL M]

If [Grinding] = True Then
MsgBox "Do not enter data!"
Else 'nothing
End If

You may want to think about locking/disabling the text box depending
on the value of [Grinding]

alex
 
Brilliant!! Thanks for your help

alex said:
Hi is it possible for a warning message to appear if a user tries entering
data in a field?
If a user selects the [Grinding] check box they will not need to enter data
in the [TSL M] field. But I still have some users that accidently do this.. I
would like a Beep and msgbox to say "If the Grinding box has been selected,
do not enter data" Is this possible?

Jo,

In the On Enter event of [TSL M]

If [Grinding] = True Then
MsgBox "Do not enter data!"
Else 'nothing
End If

You may want to think about locking/disabling the text box depending
on the value of [Grinding]

alex
 
Second that. Disabling a control is a much more user-friendly way of
operating than allowing a user to do something, then yelling at them for
doing it. If you know in advance that you don't want a user doing something,
arrange your app in such a way that it simply can't be done.

Pete



"alex" <[email protected]> píse v diskusním príspevku
Hi is it possible for a warning message to appear if a user tries entering
data in a field?
If a user selects the [Grinding] check box they will not need to enter
data
in the [TSL M] field. But I still have some users that accidently do this.
I
would like a Beep and msgbox to say "If the Grinding box has been
selected,
do not enter data" Is this possible?

Jo,

In the On Enter event of [TSL M]

If [Grinding] = True Then
MsgBox "Do not enter data!"
Else 'nothing
End If

You may want to think about locking/disabling the text box depending
on the value of [Grinding]

alex
 
Hi Alex how would i go about locking/disabling the text box, in the
properties dialog its either Yes/No answer for Enable/Locking and does not
give the option to do any else?


alex said:
Hi is it possible for a warning message to appear if a user tries entering
data in a field?
If a user selects the [Grinding] check box they will not need to enter data
in the [TSL M] field. But I still have some users that accidently do this.. I
would like a Beep and msgbox to say "If the Grinding box has been selected,
do not enter data" Is this possible?

Jo,

In the On Enter event of [TSL M]

If [Grinding] = True Then
MsgBox "Do not enter data!"
Else 'nothing
End If

You may want to think about locking/disabling the text box depending
on the value of [Grinding]

alex
 
Hi Guys thanks for all your help, I found another way which works and that
was to use the conditional formating. There is an option to disable the field
if the criteria is met. e.g [Grinding]=Yes (the field is then grayed out and
disabled)
thanks again.

KenSheridan via AccessMonster.com said:
You need to do it in code in two places; firstly in the form's Current event
procedure to handle when the user navigates to an existing or new record;
secondly in the AfterUpdate event procedure of the Grinding control for when
a user updates that control. In the latter you will also need to remove any
existing value from the TSL M control as otherwise a perverse user could
uncheck Grinding then enter a value in TSL M, and then go back and check
grinding, resulting in inconsistent data. This may sound an unlikely
scenario but Murphy's Law dictates otherwise!

So, the code for the form's Current event procedure will be:

Me.[TSL M].Enabled = Not Nz(Me.Grinding,False)

The Nz function is used here to return a False value if Grinding is Null.
Although a Boolean (Yes/No) column can only have values of True or False,
when you first navigate to a new record in a form the check box control bound
to it will be Null until you begin to enter data in the form.

The code for the Grinding check box control's AfterUpdate event procedure
will be:

If Me.Grinding Then
Me.[TSL M] = Null
Me.[TSL M].Enabled = False
Else
Me.[TSL M].Enabled = True
End If

Ken Sheridan
Stafford, England
Hi Alex how would i go about locking/disabling the text box, in the
properties dialog its either Yes/No answer for Enable/Locking and does not
give the option to do any else?
Hi is it possible for a warning message to appear if a user tries entering
data in a field?
[quoted text clipped - 16 lines]
 
Back
Top