|
||||||
|
Access Q&A: Sort, Group, DateDiff, Forms!Field By Richard Rost Here are some Access questions I've answered recently. Have your own Access question? Submit it on the Tips Page. Hello Richard, I’m building an Access application that registers clients who comes into an office, after registering they are forwarded to an interview process. I need to track the time from when they register to when the interview begins (WaitTime), and the length of the interview (InterviewLength). The registration information is stored in registration table that is link to interview table that stores the interview information. I’m using the function “=Now()” to record the registration time and the interview start and end time. How do I stop the timer when the interview begins and end. And can I use the function “DateDiff(“n”,ReistrationTime-InterviewStart)” to calculate the wait time and the interview length? I would use a button to close your form where the interview is taking place. This way, the OnClose event could save the time in your table, and you wouldn't need a Timer function. Just mark the time the form was opened and closed. Yes, you could use the DateDiff function, but you can also bank on the fact that one day = 1 in Access. So if you simply subtracted the start time from the end time, you're left with a fraction of a day (so 12 hours = 0.5). Multiply that by 24 and you have the number of hours. I start talking about Event programming in my Access 206 tutorial (www.599cd.com?GOAC206) and time differences in Access 221 (www.599cd.com?GOAC221). I have multiple sub-reports, each based on a parameter query. The criteria field is the same in all of them. When I create a main report, it asks me to input the parameter value as many times as there are sub-reports. Is there a way that I can give the parameter value only once for the main report? Certainly. Use a form to supply your parameter. You can refer to it as Forms!FormName!FieldName from inside your report or query. Then, just use a command button on the form to open your report. I cover this technique in my Access 202 Tutorial (www.599cd.com?GOAC202).
Subscribe to Access Q&A: Sort, Group, DateDiff, Forms!Field Get notifications when this page is updated |
||
|
| |||
| Keywords: access tips PermaLink Access Q&A: Sort, Group, DateDiff, Forms!Field |