Is this even possible?

  • Thread starter Thread starter Del
  • Start date Start date
D

Del

Hi all,

I am trying to create a data entry form that can be used to fill in a log
sheet. I need this to allow data entry based on the time of day. i.e. if
the time is between 07:00 and 19:00, I want to enter todays date into a Date
field on the form , in a Shift field on the form I want "DAYS" to be
automatically entered. If the time is later than 19:00 I would like the
Shift field to have "Nights" entered automatically with the Date field again
having todays date. If the time is prior to 07:00, I would like yesterdays
date to be entered into the Date field and "Nights" to be entered into the
Shift field. To further complicate this, is there a way to only allow data
entry to the record corrseponding to the current timeframe? i.e. Assuming
it is 08:00 on the 16th August, I would like the forms Date field to show
16/08/2003 and the Shift field to show DAYS, data would be
enterable/editable for this time period, but access to previous records
would not be possible.

I hope this makes sense.

Thanks in advance for any help.

Del
 
Del,

Yes, this is possible, but you'll need to code it. Use the Date() and
Time() functions in the OnOpen event of the form to set the default values
of the fields, and don't allow the fields to be edited. If you need to deal
with a form that's opened at, say 6:55 and used until 8:03, and you need to
change the values, you'll need to add a Timer. That's going to be a little
ugly, I'm afraid, but it's doable.

HTH

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 
Thanks Rebecca, it gives me a starting point.

Rebecca Riordan said:
Del,

Yes, this is possible, but you'll need to code it. Use the Date() and
Time() functions in the OnOpen event of the form to set the default values
of the fields, and don't allow the fields to be edited. If you need to deal
with a form that's opened at, say 6:55 and used until 8:03, and you need to
change the values, you'll need to add a Timer. That's going to be a little
ugly, I'm afraid, but it's doable.

HTH

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 
Back
Top