Link to home
Create AccountLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Message box when user clicks on any of several fields on a form

I have several fields on a form that display information only.  They are not meant to have data entered or edited.  The fields are all locked and tab stop = No.

In each of the fields I have the tag property set to "Viewable" (without the quote marks.

But if the user clicks on any of the fields I want a msgbox to appear that says "Viewable information only"

Is there a way to make this happen in the oncurrent event of the form?  Or ?  Or do I have to put the msgbox code in each fields on click event?  There are several.
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Instead of displaying a message box, it may be a better approach to use a visual clue that the field is locked, such as changing the text color or the background color. By displaying the message box, an inadvertent click in one of the fields will cause the message box to display and what seems to be a benign alert can quickly become an large annoyance.

Also, if for some reason your user wanted to highlight text in the locked control (textbox) to copy/paste the text elsewhere, this message box again would be an annoyance.
Avatar of SteveL13

ASKER

I very much do appreciate your insight.  But in this case we really do want a message box to appear.  Can it be done without having to write the code behind each field's onclick event?
SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account