Solved

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

Posted on 2016-07-19
4
14 Views
Last Modified: 2016-07-19
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.
0
Comment
Question by:SteveL13
  • 2
4 Comments
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 41719456
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.
0
 

Author Comment

by:SteveL13
ID: 41719463
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?
0
 
LVL 26

Assisted Solution

by:Shaun Kline
Shaun Kline earned 250 total points
ID: 41719475
You could write a subroutine that displays the message, but you probably will have to tie it into each field's onclick  event. The onCurrent event of the form happens when the form opens or when the user changes records.
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 41719497
yes you can

create a function in a regular module

function showMessage()
msgbox  "Viewable information only"
end function

in the click event of the textbox place
=showmessage()
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now