Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Setting 30 minute time increments in Access 2007 form

Posted on 2011-02-24
7
Medium Priority
?
499 Views
Last Modified: 2013-11-28
I have a form that has a StartTme (date/time) field formated as General Number.  I want the StartTme field to auto populate the Time, Time1,Time2,Time3, etc.(Time - Time28) in increments of 30 minutes.  I tried wrting an event procedure but it's not working correctly: Me.Time = [StartTme] + 30.  
0
Comment
Question by:GMCAH
[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
7 Comments
 
LVL 40

Accepted Solution

by:
als315 earned 1500 total points
ID: 34972764
Try Me.Time = Dateadd("n",30,[StartTme])
0
 

Author Comment

by:GMCAH
ID: 34973234
Hi,
It's not working as expected.  The event procedure I was using is working perfectly except when the time entered is 11:30.  If the time entered is 11:30 then the time displayed is 1160 and not 12:00.  
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34974848
Then it seems that it is not clear as to what exactly your "time" data is.
Can you elaborate?

Typically a "Time" is actually represented in fractions of a day (.5=12 noon)
Typically a Day is an whole number.
For example 3/4/1945 is actually 20518
Hence: 3/4/1945 12 pm is actually: 20518.5

So when you say that the Time displayed is 1160, I am more than a little confused...

Also remember that a Time, is usually accompanied by a date component.
Also try not to name your Objects with keywords like "Time", as this will cause problems if they are not referenced correctly.
(Use something like StartTime, EndTime, ...etc)


;-)

JeffCoachman

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 40

Expert Comment

by:als315
ID: 34977311
May be you can upload you form?
0
 
LVL 1

Expert Comment

by:jimbuckleybarrett
ID: 34978336
Why do you have the date/time field generated as a number?  StartTime is a date/time so leave it formatted a date/time.

Then try as als315 suggested

Time.text = Dateadd("n",30,[StartTme])
Time1.text = Dateadd("n",60,[StartTme])

Don't froget to set the format fo the Time textboxes as date/time

Jim
0
 

Author Comment

by:GMCAH
ID: 34982096
Thanks everyone.
The solution was to change the field back to a date/time field (which it orignally was) and modify the event procedure
Time = DateAdd("n", 30, [StartTme])
Time1 = DateAdd("n", 60, [StartTme])
etc.
0
 

Author Closing Comment

by:GMCAH
ID: 34982201
All information was not provided with the original response i.e., verify the field format setting is medium date.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

715 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