Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access Form best way to capture time increments

Posted on 2010-11-21
7
Medium Priority
?
452 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

916 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