Is there a way to lock records in the browse window? I need to be able to let the users add new records and edit each field, but also ensure they don't edit existing fields in that same browse window. Thanks!
There are a variety of ways to approach your goal. Here are a couple of them.
1. Use the Browse window to display existing records in a Read-Only manner. As new records are added to the table they too will be displayed as Read-Only in the Browse window.
To Add new records, place Get fields on the same screen (use GENSCRNX to combine Browse & GET fields). These GET fields will hold memory variables. The users enter desired data into these fields and then press a SAVE key and the new record is APPENDED and the contents of the memory variables are REPLACED into the new record.
2. Do everything within the single Browse window.
Add an additional logical field to the table being Browsed and named something like LOCK or READONLY, but it should not be displayed within the Browse.
On originally opening the table in the Screen, REPLACE ALL LOCK WITH .T.
As new records are added, this field is defaulted to .F.
Now go into the WHEN and VALID snippets of the and check for the value of this LOCK field. If it is TRUE then do not allow changes and revert field value to original value (gathered and saved in the WHEN code).
Good Luck,
JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
I really like the sound of your second option, I'll play around with it and see if I can get it to work.
The other part is to convince the client to make the change, the application is scheduled to be replaced by next February. Therefore they don't want to throw a lot more time into it, but as it stands it is causing data problems...but I digress....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.