Access custom date/time format and input mask error -
i have database need store bunch of times , calculations based on times, however, times can on different days using time format wont calculate correct difference between two. ease of use wanted limit how of date have input because there bunch of times , dont want have type full date each time. created following custom format: 16-jan 15:00 (d-mmm h:nn)
i created custom input mask go this: 90-lll\ 90:00
my form fields have same format , input masks match. initial input of field works right, issue comes when try edit field , change 1 digit. pops error doesnt match input mask, though does. in order change field have delete everything, remove focus textbox , click in. there anyway fix that? or there option calculate difference between times without having use date when on 24hrs long (not longer 48 though)
yes, can have checkbox, nextday, mark if end time of following day.
then timespan be:
dim timespan date timespan = cdate([endtime] - [starttime] + abs([nextday]))
to input time, can use method here: entering 24-hour time
to format , display timespan, values above 24 hours, use function this:
public function formathourminute( _ byval dattime date, _ optional byval strseparator string = ":") _ string ' returns count of days, hours , minutes of dattime ' converted hours , minutes formatted string ' optional choice of time separator. ' ' example: ' dattime: #10:03# + #20:01# ' returns: 30:04 ' ' 2005-02-05. cactus data aps, cph. dim strhour string dim strminute string dim strhourminute string strhour = cstr(fix(dattime) * 24 + hour(dattime)) ' add leading 0 minute count when needed. strminute = right("0" & cstr(minute(dattime)), 2) strhourminute = strhour & strseparator & strminute formathourminute = strhourminute end function
Comments
Post a Comment