Solved

Access Form best way to capture time increments

Posted on 2010-11-21
7
435 Views
Last Modified: 2012-05-10
Dear Experts,

I am creating a login form for Parent/Teacher conferences. When the form loads I write the current time a hidden text field on the form bound to the table's  'time in' field. I would like to place a control on the form to allow users to select how long they expect the conference to last. They can select this time and submit the form. The idea is that if the Parent selects, say, 1 hour, then I would add one hour to the current time on the submit button's onclick event.

I was thinking about using a combo box with times in 15min increments. So if the parent/teacher conference will last 30 minutes users would select the second item. How would I then add 30 minutes to the 'time in' time value and then write that value to the table's 'time out' field?

A conference would not be more that four hours so a combo box should work unless you can suggest a better approach.

Thanks!
0
Comment
Question by:shogun5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 34183022
Shogun,

See attached db. You might get an idea from it. I used DateAdd function to achieve what you want.

Sincerely,
Ed
SampleDB.accdb
0
 

Author Comment

by:shogun5
ID: 34184448
MINDSUPERB:

This might work. How would I increment from TimeLast instead of Now().

In other words,

SELECT Table2.TimeIncrement, Table2.TimeValue, DateAdd('n',[TimeValue],Now()) AS [TimeStamp] FROM Table2;

should be something like:

SELECT Table2.TimeIncrement, Table2.TimeValue, Table1.TimeLast, DateAdd('n',[TimeValue],[TimeLast]) AS [TimeStamp] FROM Table2;

But the query keeps asking me for TimeLast value. I do not know this well enough. What I would like to do is to use say TimeLast as my (Time In) value and add the TimeValue to this (TimeLast) value to get the TimeOut value. Right now the code you provided gives me increments from the current time Now() but would like to get this from the time the users signed in.

Hope this makes sense.... Let me know if you need more clarification.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34188122
<No Points wanted>

You may want to add a "Submit" button to the form.

Technically, this is not needed (Because Access saves records automatically)
But most users like the "Assurance" of a submit button.
This could also be used to move to a new record.

Something roughly like this on the Submit button:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec

But again, this is just a suggestion, as what MINDSUPERB posted seems to do what you requested in it's basic structure.

;-)

JeffCoachman
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 34188179
Shogun,

If you can post a sample db, I may assist you efficiently. I need to look into how your existing relationships of your table as well as on what form the combo box is placed.

Ed
0
 

Author Comment

by:shogun5
ID: 34196239
MINDSUPERB:

Attached is a sample of what I am working on. In the frmParentConference above the [sign] button I need to put in a combo box with 15 min increments. When the user select a value in the combo box that value should add to the time in value in visLogTimeIn field. That added time needs to go into visLogTimeOut field.

Thanks!

Mike
sampleDBtime.accdb
0
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 500 total points
ID: 34196405
Shogun,

See attached DB for the integration.

Sincerely,
Ed
sampleDBtime.accdb
0
 

Author Closing Comment

by:shogun5
ID: 34196612
MINDSUPERB:

Thanks. This gave me want I needed to accomplish the task.

I create a hidden textbox on my form bound it to the time out field and used the following code on the form's onclick event:

Me.txtTimeOut.Value = DateAdd("n", Me.cboTime.Column(1), Nz([VisLogTimeIn], 0))
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question