Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format date without AM\PM?

Status
Not open for further replies.
Feb 6, 2003
22
US
My users want to type the least amount possible. Since the times we are keeping track of are between the nowmal working hours of eight to five. The AM\PM designation really isn't necessary. We'll always know whether it's AM or PM based on the time. The short date format still includes AM PM. Is there a way to get around this and just have users enter a time without AM\PM??

Thanks so much,

Michelle
 
Are they typing this information thru a form or directly into the table?

HTH
Mike

[noevil]
 
Ok,

On the field AfterUpdate event procedure try something like this:

Code:
Private Sub YourField_AfterUpdate()

    If left(YourField, (InStr(1, YourField, ":") - 1)) < 6 Then
        YourField= Format(DateAdd("h", 12, YourField),"Medium Time"
    End If

End Sub

The default is AM so you would need to add 12 hours to change it to PM.

HTH
Mike

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top