Where do I put the code to check if a date is between to dates?

  • Thread starter Thread starter Erin Freeman
  • Start date Start date
E

Erin Freeman

Hi there,

Here is the scenario.

We have a large database that is going to be split with up to 8 users.
This database consists of over 2000 nurses.
I need to have a piece of code that is always refreshing to check if the
nurse is on assignment. There is an assignment start date and an assignment
end date. so if todays date is between those two dates, the check box of "On
Assignment" automatically checks off. I am not sure where to put the code, do
i put it when the database opens? I supposed this code just needs to run the
first time it opens every morning... Any help would be appreciated....on the
code as well

Thanks in advance
 
Realistically, On Assignment shouldn't be stored in the table. Instead, it
should be a computed field in a query:

OnAssignment: [Assignment Start Date] < Date() And [Assignment End Date] >
Date()

or

OnAssignment: Date() Between [Assignment Start Date] And [Assignment End
Date]
 
thank you so much!

Douglas J. Steele said:
Realistically, On Assignment shouldn't be stored in the table. Instead, it
should be a computed field in a query:

OnAssignment: [Assignment Start Date] < Date() And [Assignment End Date] >
Date()

or

OnAssignment: Date() Between [Assignment Start Date] And [Assignment End
Date]

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Erin Freeman said:
Hi there,

Here is the scenario.

We have a large database that is going to be split with up to 8 users.
This database consists of over 2000 nurses.
I need to have a piece of code that is always refreshing to check if the
nurse is on assignment. There is an assignment start date and an
assignment
end date. so if todays date is between those two dates, the check box of
"On
Assignment" automatically checks off. I am not sure where to put the code,
do
i put it when the database opens? I supposed this code just needs to run
the
first time it opens every morning... Any help would be appreciated....on
the
code as well

Thanks in advance
 
Back
Top