Solved

Access Form best way to capture time increments

Posted on 2010-11-21
7
424 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now