View Single Post
  #3  
Old January 29th, 2010, 01:23 PM posted to microsoft.public.access.tablesdbdesign
Rachel
external usenet poster
 
Posts: 187
Default Time Input Mask to show "5:35pm" ONLY

Thanks for your reply Piet.
I'm not sure how to assign this that particular field.
Do I use the macro builder or the properties sheet....?
sorry, trying to self teach


"Piet Linden" wrote:

On Jan 28, 9:44 pm, Rachel wrote:
Hi there,
I am trying to get me date/time field in both the table and form to show
only 0:00pm... 5:35pm as an example.
I have tried a few different input masks the closest one I have got is
0:00\pm, however when I type the time into the field (by only typing 535) it
automatically changes to 5:35AM.
I don't need the AM option at all as all times entered will be a PM time.
Therefore I want it to automatically update as PM.
I also only want to have to type the numbers as indicated before 535. I
don't want the leading zero (05:35pm) and I dont want to have to type the :
nor p/pm.
Hope this makes sense, any help is much appreciated
Rachel


Private Sub UpdateToPM()
If StartTime #12:00:00 PM# Then
StartTime = DateAdd("h", 12, StartTime)
End If
End Sub

Private Sub StartTime_AfterUpdate()
Call UpdateToPM
End Sub

In a word... add 12 hours to your date if it's before noon... like the
above... tweak to suit.
.