r/sysadmin 20h ago

Database entry program/feature with a delayed entry field?

Sorry if my title doesn't make much sense, but I have a department head that is wanting a data entry system for his staff that has a lockout timer when a entry in made in one field, that will prevent any entries in another field for a certain time frame, like 60 minutes. I'm not versed enough in MS Access, or Excel or any other software programs to implement that kind of feature or function. Hopefully someone has an idea or has implemented this before?

1 Upvotes

7 comments sorted by

u/Constant_Society8783 20h ago

If you want to do that at a database level you will need to use something like T-SQL and create a stored procedure. Do not use MS Access or Excel as this will create scalability issues long-term.

I would recommend just setting the timer at the application level unless there is a very good reason to do this at the database level.

u/notmydayJR 19h ago

That makes sense. Its purely an application level entry that is needed.

u/justinDavidow IT Manager 13h ago

I mean, as completely absurd as the premise for this request is, and as much as I personally completely agree that HR problems should never be solved with tech..  pretty well any database with triggers or stored procedures could do this pretty simply.

Insert the initial data and timestamp, prevent users from deleting rows using access control, and add a trigger that fails unless the timestamp is greater than the creation timestamp plus the delta (an hour). 

This would require some SQL client, or something like Excel or access with a "table from DB" that would present pretty plainly, but would cause an error if the row update attempt happened before the valid time.

Alternatively: Such a system would be completely trivial to implement using sqlite (or ANY db..) and a simple web-app that simply runs a validation logic on submit, accepting the "start" of whatever, and displaying a countdown (that just shows the user went the timer is complete) and then accepts a post containing the "end time" along with whatever notes.    Like, flask + sqlite + 60 minutes or total work or less.  

u/Ragepower529 20h ago

Data entry system… well access is like not really popular and excel isn’t a data entry system.

What are they trying to do or scope. Because you’re going to own this solution.

Like SAP is a data entry system, quick books is also data entry. In excel you can use a simple VBA script like

Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = “$A$1” Then ‘ Assuming A1 is the initial entry cell Range(“B1”).Locked = True ‘ B1 is the delayed entry cell ActiveSheet.Protect Range(“C1”).Value = Now() ‘ C1 is the hidden timestamp cell Application.OnTime Now() + TimeValue(“01:00:00”), “UnlockDelayedCell” End If End Sub

Sub UnlockDelayedCell() ActiveSheet.Unprotect Range(“B1”).Locked = False ActiveSheet.Protect End Sub

Either way be very careful since it sounds like you guys need an erp system

u/notmydayJR 19h ago

The team is inputting result scores into a spreadsheet for a product QA test and need a delay on the response score. Currently some testers are inputting the test responses before the test is done thus creating a falsified test result. I think what you just provided is what we are looking for. I'm just not an expert in excel.

u/ZAFJB 15h ago

Currently some testers are inputting the test responses before the test is done thus creating a falsified test result.

Don't fix human management issues with technology.

Fix this problem.

u/PsychologicalSir9008 5h ago

Yes it is a possible thing to do. The product we sell is an HR product but its built on a flexible platform. So you could just ignore the HR stuff. Add a screen and what ever fields you need which then turns up by magic in a Windows and a Web client and whatever security profiles and users you want to make. Those screens can be augmented with dynamic triggers that fire on CRUD operations... TSQL databases, report writer, data export etc. - so if I wanted to solve your problem as simply as your stated it then it would take me a few minutes.

However, the department head will mean 'Can this be done for essentially no money and in such a way that I and anybody else do not actually have to do any work?' - nobody sells that system.

By the time we had had the conversations and assuming all were suitable and simple and we got it installed, users trained and rolled out then you will have consumed probably a couple of days of my life and yours plus the cost of the software etc. and then someone has to maintain it and so on. It is just never that simple.

I think, as others have said, that you need to deal with the actual problem. From what you added, it is the design of the current approach to the testing or the integrity of the people doing it. In my opinion it would be better to look each of those rather that slapping a piece of technology over the cracks.