?
Solved

Access Form best way to capture time increments

Posted on 2010-11-21
7
Medium Priority
?
447 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

718 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