Solved

Display time on a form

Posted on 2014-01-31
7
253 Views
Last Modified: 2014-02-01
I have a date time field on a form displaying like:

1/13/2014 2:14:58 PM

But I want it to just display the time like:

14:14 (military time)

with no date or seconds.

How can I do this?
0
Comment
Question by:SteveL13
  • 4
  • 3
7 Comments
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39824180
Apply the format to the textbox: hh:nn

/gustav
0
 

Author Comment

by:SteveL13
ID: 39824213
I put hh:nn in the format line of the form properties and still get

1/13/2014 2:14:58 PM
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39824242
It's the Format property of the textbox bound to the field. It will work if the data type is Date.

/gustav
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:SteveL13
ID: 39824569
It's an unbound text box that gets it's value from an afterupdate event of a combobox query.

That part of the SQL for the query is:

tblPreparation.EndTime AS TOC

Do I need to alter that somehow?
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 39824593
Yes and no. The checkbox returns a string.

You could try converting the value:

    Me!txtTime = TimeValue(Me!cboTime)

still using the hh:nn format, or - to force the time to a string:

    Me!txtTime = Format(Me!cboTime, "hh:nn")

or, if that fails:

    Me!txtTime = Format(TimeValue(Me!cboTime), "hh:nn")

/gustav
0
 

Author Comment

by:SteveL13
ID: 39825041
This worked...  Thanks.

Me!txtTime = Format(Me!cboTime, "hh:nn")
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39825192
You are welcome!

/gustav
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now