Solved

Access Form best way to capture time increments

Posted on 2010-11-21
7
419 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

12 Experts available now in Live!

Get 1:1 Help Now