Preventing anyone from changing data

zooto68

New member
Local time
Today, 14:20
Joined
Sep 7, 2005
Messages
6
Hello,

I am new to VBA so apologies if I ask any dumb questions. Please find enclosed a copy of a database I am working on.

I want it so that I can set the column marked "Locked" in the Log Table to either 0 for unlocked and 1 to locked. Then at 0730 each morning I want the database to set all fields to 1. This will then lock the record.

I then want it that when people are using the Log Form, that the text boxes, etc. are locked if it reads a 1 in the 'locked' field of the table so that the user cannot enter anything or change anything.

Can you please tell me how I can code this?

Thanks
 

Attachments

Hi,
maybe you can clarify a little more!
Why do you want to do this? Do you want to do certain maintainance things at that time and keep users out? Maybe you can explain what it is you are trying to achieve.
HTH
Good luck
 
We need the user to be able to create a new record and make entries and also go back to that record to add data at a later time.

However, at 0730 each morning, the system will go through all records up to that point and mark them as locked so that no changes can be made to data already entered.
 
try this

CurrentDb.Execute ("UPDATE [Log Table] SET Locked = 1")

to update the records to locked status

The locked status you want a statement similar to this, but not sure where to put it (cant even remember what to use in the if condition, im half asleep :))

if locked = 1 Then
textbox.locked = true
else
textbox.locked = false
end if
 

Users who are viewing this thread

Back
Top Bottom