Lock record after midnight each day

G

Guest

I am trying to lock a record or set of records after midnight each day.
Would appreciate any help you can offer. Thank you
 
J

Jeff Boyce

Linda

Define "lock"... (not so much in terms of "how", but in terms of what you
do/don't want to have happen with the data in the record)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Thanks Jeff,
I am trying to make the record completely uneditable after midnight. I do
not want to do anything at the table level, just at the form.

I am not very familiar with writing code - will need detail explanation if
you can help

Thanks
 
J

Jeff Boyce

Linda

I suppose one approach to this would be to have the form "check" to see what
the date was on the record ... this would require a field in the table to
hold something like a DateCreated. You could have this default to Date() so
that new records would get this date stamp.

Or if the sequence of new records might be important, use Now() to get date
AND time.

So, as a generic approach, if your form checked the DateCreated date on each
record and, if it found the date was before today, would lock the the
controls. You'd need code to cycle through the controls on the form, and if
the control was a textbox, a combobox, a listbox, a checkbox, or an option
group (and any others that might "hold" data), then you'd set the Locked
property to Yes.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top