What do you mean by "not able to use the time() function here"? Are you
saying that trying to use it raises an error?
It could be a case that your References collection has got messed up.
References problems can be caused by differences in either the location or
file version of certain files between the machine where the application was
developed, and where it's being run (or the file missing completely from the
target machine). Such differences are common when new software is installed.
On the machine(s) where it's not working, open any code module. Select Tools
| References from the menu bar. Examine all of the selected references.
If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.
If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)
I
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"QuantumLeap" <(E-Mail Removed)> wrote in message
news:3B01EC51-9653-4514-877F-(E-Mail Removed)...
> I have a form that currently prompts workers to enter their shift number
(1
> or 2). I would like to automate this so if the time is between 3:30 AM
and
> 3:30 PM, the shift is 1, with a shift of 2 at all other times. I have
tried
> using a set value macro with an if statement of
>
> iif (Time() between #3:30:00am# and #3:30:00pm#, 1, 2)
>
> but I am not able to use the time() function here (I do not use it
anywhere
> else in the database).
>
> How can I automatically set the shifts?
>
> Thank you