Re: Guidance on entering and display date & time

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Wed, 4 Jun 2008 07:39:05 -0700, RichKorea
<RichKorea@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I?m putting together a service database that uses a form based on a query for
the data input and display. I need to track when the call came in for
service, when the work started, and when the work was completed. My plan is
to use the three date/time values when preparing a report to calculate how
long it took to show up from when the call came in, and how long it took to
do the repair.

I?m thinking I want three fields in the table (Call, Arrive, and Finish).
There would be two combo boxes (one for the date and one for the time) for
each field, such that the user can enter the date and the time (or change the
date or time), and the values would then combine for saving in the field.
When displaying a record, the reverse would need to happen.

Is there a sample database or explanation on Microsoft.com that provides
guidance on how to handle dates and time?

One other question ? the Active X calendar in Access works great for
entering the date. Is there something similar for entering the time?

Thanks,
Rich

Dave's absolutely right: do NOT use separate textboxes for the date and time,
it just makes things harder, not simpler.

I wouldn't require the user to type either. Depending on how you are entering
the record, you could either set the Default Value of the field to =Now() to
fill in the date and time the instant a record is started (this would probably
be appropriate for the Call field); or use a single line of easy VBA code in
the textbox's DoubleClick event:

Private Sub txtArrive_DoubleClick()
Me!txtArrive = Now
End Sub

where txtArrive is the name of the textbox bound to the Arrive field. The user
can still overtype it if needed (and if that's permissible...!).

You can easily calculate the time on site etc. using the DateDiff() function
in your report, or in the query upon which you base the report.
--

John W. Vinson [MVP]
.



Relevant Pages

  • Re: Emailing an individual record
    ... You would need to create a report to display the data ... Private Sub Print_Button_Click ... that I am currently entering into the form, or would like to set up a button ...
    (microsoft.public.access.forms)
  • Re: Displaying Multiple photos on report
    ... Would like to print a report for an ID with all of the associated photos ... I use the MS help for displaying images and that is fine, ... Can't find an appropriate Event item to get this to display the correct ... associated with images in OLE Objects. ...
    (microsoft.public.access.reports)
  • Re: Dynamic Reporting based on Parameterized Crosstab Query
    ... The tek-tips solution does display the actual date on the report. ... on the first 3 rowwise fields of the crosstab query. ...
    (microsoft.public.access.reports)
  • solution for sections do not fit vertically on the page datareport error message
    ... In order to avoid the case where a data report viewing is constrained ... you will need to execute api commands ... knwoledge they change the printer to the screen display. ...
    (microsoft.public.vb.winapi)
  • Re: PLEASE HELP: Refresh columns displayed in a report from a quer
    ... I have basically put about 10 extra columns in the report, ... column display is driven by user selection on the form, BUT is there a way to ... are operating at run time, not design time, so CreateReport ... ' Create new text box control and size to fit data. ...
    (microsoft.public.access.reports)