Solved

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

Posted on 2016-07-19
4
17 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

770 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