Solved

Blocking data entry

Posted on 2007-11-15
3
186 Views
Last Modified: 2013-12-18
Have a field which asks the user if they are a registered representative. Have another field which asks for their agent_ID, I know how to force the input if the response to the initial registered representative question is yes, but how do I block the input of the field if the response is No.  Can entry to a field be prohibited with explanation as to why they are not allowed to enter a value.
0
Comment
Question by:jforget1
3 Comments
 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 500 total points
ID: 20289269
Sure.

One way is to hide the field when input is not required and show it when it is.  Here's an example:

Say you have a radio button named "registered_Rep" that has the choices "Yes" and "No".  The dependent field is named "agent_ID" and will only be visible if "registered_Rep" contains "Yes".  If "registered_Rep" contains "No", then the "agent_ID" field is hidden and is replaced by a message stating "Agent ID is not required".

To make this happen, you would need to place this hide-when formula on the field:

registered_Rep != "Yes";

Then, on a separate line (probably right under the field), add the text "Agent ID is not required" and place this hide-when formula on the text:

registered_Rep = "Yes";

To enter a hide-formula, place your mouse cursor on the paragraph to hide and display the properties window (Edit \ Properties).  In the properties window, switch to the "Hide-When" tab.  Check the "Hide paragraph if formula is true" checkbox and enter the formula in the field.  Hide-formulas are applied to block paragraphs (like a table cell or paragraph of text).

Now, we need to tell the "registered_Rep" field to refresh the form each time it is changed so that the hide-formulas will be re-evaluated.  To do this, select the "registered_Rep" field and display it's properties window (View \ Properties).  Now switch to the 2nd tab (Control) and select the "Refresh fields on keyword change" checkbox. Lastly, for radio-buttons, we need to enable an additional property.  Switch to the 3rd tab (Advanced) and select the "Run Exiting/OnChange events after value change" checkbox.

That should do it.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 20289375
You can use a simple hide when.  In that case, you must have your controlling field be a checkbox or radio button with "refresh on change" turned on.

Another way is via the Entering event or the similar onFocus event. You can put in code there to check the controlling field, and if it is not set, then remove focus from the field.  The user can try to enter it but will never succeed.
0
 

Author Comment

by:jforget1
ID: 20289538
I don't know why that did not occur to me, started thinking specifically of the validation area and not of just using a good old hide/when.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

758 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

18 Experts available now in Live!

Get 1:1 Help Now