esteshk Posted April 29, 2002 Share Posted April 29, 2002 I need to define a field that cannot be changed once a value is entered. In other words, if the field is empty, a user can enter a value, but once a value is added, no further alterations can be made. Any suggestions? Link to comment Share on other sites More sharing options...
andygaunt Posted April 29, 2002 Share Posted April 29, 2002 Is this just for one field. You could write a script that is called by clicking on the field. If notIsEmpty (fieldnamehere) Exit Script Else Go to field (fieldnamehere) You will have to set the field to not allow entry from the field format menu, otherwise the user can tab into it and change the contents. Link to comment Share on other sites More sharing options...
esteshk Posted April 30, 2002 Author Share Posted April 30, 2002 Yes, that's how I currently implement this feature. What I'm looking for is a field level solution. Honestly, I don't think it's possible but some of you guys out there are really clever! Link to comment Share on other sites More sharing options...
Gogargirl Posted April 30, 2002 Share Posted April 30, 2002 Well, there's a way to do this, but you need an extra field. Let's assume that the field you want to control modification of is a text field called Data_Entry. Create a text field called Data_View, and set it to auto-enter with the calculated value from the field Data_Entry. Then create a validation for Data_Entry. Validate with the calculation: (Data_View=Data_Entry) or (IsEmpty(Data_Entry)) Check "Strict" and provide a custom message something like "You cannot modify this field". Place Data_View on your layout and disallow entry. Make Data_Entry transparent and exactly the same size as Data_View. Place it exactly on top of Data_View. You can then enter an initial value in Data_Entry, which automatically transfers to Data_View. To the user, all this just looks like they are working on one field. The validation will fail if you try and enter a new value. You can achieve almost the same thing without the validation on Data_Entry. Instead, check "Prohibit modification of value" in the auto-entry option for Data_View. Problem is, it's not very user friendly as it won't erase the new value you are trying to enter and you won't get an error message telling you what you're doing wrong. One last thing, remember to back-up before you go messing with your field definitions! Alison Link to comment Share on other sites More sharing options...
RussBaker Posted April 30, 2002 Share Posted April 30, 2002 Here is a technique I have used for record locking after a certain period of time. It was used for a straight data-entry situation so it may not be applicable to you if multiple changes are being made to other fields in the record. In this case, it works on a certain number of seconds - which were stored in a global field using SetField on startup. After the user has entered the data in a record, they can correct it for xxx seconds, then thay can't change fields for which this is the validation. You will need fields for auto entering the modification date and time. You could modify this to use a dedicated modification date and time for a single field by using a script which sets them as per AndyGaunt's reply. This way, your users at least get a chance to correct a typo they may have made on data entry. Setting g_Seconds to Modify to 300 will give them 5 minutes... The validation = (Status(CurrentDate) - Mod Date)*86400 + (Status(CurrentTime) - Mod Time) < g_Seconds to Modify Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 8192 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now