Unanswered: lock a previous record once a new record is added?
First off, I greatly appreciate all the time, help, and guidance that so many provide on this site. After reading most of the old posts it becomes very apparent that there are many people that sincerely believe in BD and show it with their gift of time as well as showing the same respect to green amateurs (such as myself) as they do the seasoned pros. (This virtue is very rare in so many forums)
Would someone know the answer or point me in a direction where I could learn the answer to the following two questions?
1-Is it possible to lock a previous record once a new record is added?
2-Is it possible to switch users instead of logging off to switch users? If I read the help correctly, this is not possible.
Using edit rule and a record count field ( if record count 1 less then max count no edit) might be one way but possible other ways too.
The log off of user is a feature I requested some time ago from BD but unless in V11, no way that I know with out closing database. There may be a work around around by creating your own "lock" system with passwords and edit/visiblility rules.
Thanks for the help and info about using edit rule and a record count field . I’ve tried a few times but due to user error.. (ME)... I'm just doing something wrong. I just need to look a little harder and try a few other things to set it up per your help and info.
Thanks so much for time!!!
Is it possible to lock a previous record once a new record is added?
Place a tick box on your form and make it invisible. Now make every field on your form editable only if the invisible field does NOT = 1.
Now add a line of code to whatever button your using that creates a new record. Get this button to set the hidden field to 1 before it creates the new record.
That should do the trick.
I do this a lot of software I have running in a factory that makes baby food, so I know a number of ways you can do this. One program has a timer running that actually locks a field 30 seconds after a value has been entered.
Is it possible to switch users instead of logging off to switch users? If I read the help correctly, this is not possible.
Brilliant Database doesn't have this function itself, but you can create your own login system inside the program. I've done this for a Maintenance Team who all share the same PC.
Create a timer that on database start a variable “Staff ID” = 0
Make all folders in your database invisible if Staff ID = 0
Create a folder and form hidden from all users except you, and use that to store login details. Create a menu with 3 options, Login / Logout / Switch User.
Use the Login menu item to populate a User Input variable (Staff ID Name) and (Staff ID Password) which basically asks them for their user name and password. Once they enter the details, runs a query on the hidden folder. If it finds a record count of 1, then the user name and password were correct. If one is found, set “Staff ID” = 1.
Use the Logout menu item to set “Staff ID” = 0, so all records and folder become hidden.
And finally, use the Switch User to set “Staff ID” = 0 and everything else the Login menu item does.
This way you can hot swap users without logging out of the actual database.
Thank you for your input and showing me way to do what I would like to do. You mentioned a "Maintenance Team", that’s along the same line on who I am trying to set this up for…..just trying to bring us into this century. After I get caught up on the compressor I’m rebuilding, need to degrease and get back to trying to implement a couple of the great ideas that both you and David have suggested.
Thanks for the info and your time.
I am using the Lock Record example shown previously above. On my form I added an edit button that effectively changes the 'xrec' ID no. to the same as the current ID so the record becomes editable but limited to only members of the Administrator group.
However on my form I have a no. of Yes/No flag fields. On old records they are greyed out - no idea why. On a new record they are also greyed out and only become 'visible' by clicking on them or by clicking ouside the form itself. Until they become 'visible' all my text fields (bar my 1st one) on the new record are uneditable. I can't figure out why not.
Likewise why are the Yes/No flag fields greyed out on old records such that you lose all their colour formatting? Surely I can have them visible but non-editable? Why grey them out? No other field gets greyed out when the record is locked. Is it simply a standard property of the Yes/No flag field?
If I Add a Yes/no flag button to the Lock record example above and setting the Editabilty to the same rule as the single line text field, the flag field is greyed out so it doesn't appear to be just a property of my form.
My database is attached. Any pointers as to what I am doing wrong? I am going round in circles as you can see from some non-hidden fields that let me see if the record ID no etc. Really appreciate any help.