Code to Check a Checkbox

G

Guest

Hi,

I have a checkbox on my form called "Turnover". I would like to code the
checkbox so that it is checked automatically, depending on the following
criteria:

Jobs brought in to our department are logged in, and a field called
"ClockedIn" records the date/time the job was submitted. It's a textbox, and
the DoubleClick event is coded so that when the user double-clicks inside the
textbox, the current date and time appear (NOW()).

When the department closes for the day, the supervisor goes through and
checks the "Turnover" checkbox for all jobs still open.

I have another checkbox called "Completed". This box gets checked when a
job is done.

What I'd like to do is this: just after midnight (that is, at the start of
the next day), all jobs still left open (that is, the "Completed" checkbox
has not been checked) will automatically have the "Turnover" checkbox
checked. In addition, I want the "ClockedIn" field for those jobs to be no
longer editable.

Can I accomplish this with an If . . . Then . . . End If statement? Or, how
can I code the form to accomplish this?

Many thanks,
 
M

Mike Painter

Rosemary said:
Hi,

I have a checkbox on my form called "Turnover". I would like to code
the checkbox so that it is checked automatically, depending on the
following criteria:

Jobs brought in to our department are logged in, and a field called
"ClockedIn" records the date/time the job was submitted. It's a
textbox, and the DoubleClick event is coded so that when the user
double-clicks inside the textbox, the current date and time appear
(NOW()).

When the department closes for the day, the supervisor goes through
and checks the "Turnover" checkbox for all jobs still open.

I have another checkbox called "Completed". This box gets checked
when a job is done.

What I'd like to do is this: just after midnight (that is, at the
start of the next day), all jobs still left open (that is, the
"Completed" checkbox has not been checked) will automatically have
the "Turnover" checkbox checked. In addition, I want the "ClockedIn"
field for those jobs to be no longer editable.

Can I accomplish this with an If . . . Then . . . End If statement?
Or, how can I code the form to accomplish this?

Many thanks,

You'd have to leave the database open and run a timer of some sort.
I suspect running an update query when you open the program the next day
would work better.

But what is the purpose of the "turnover" field and why does the supervisor
have to make this decision?
A query could be run to do this but unless the turnover has some specific
not mentioned function it is not needed since Completed = False gives the
same result.

Making clocked in not editable is done on the form and would be a function
of some event like
If Turnover then
me!clockedIn.locked = True
end if
 

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