Time formt

  • Thread starter Thread starter Jessica
  • Start date Start date
J

Jessica

Hello All,


Is there a way to format the time on a report to display military time
with four digits? I have military time now but in the morning it only
shows the time with three digits.


TIA,
Jess
 
As you've probably discovered, using hh:nn in the format property changes
automatically to "Short Time". Instead, a bit of code in the AfterUpdate
event will overcome this:

Private Sub txtMyText_AfterUpdate()
Me.txtMyText.Format = "hh:nn"
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Open a property sheet for that form when it's in Design View. Click on the
Events tab. Click on the Down Arrow in the AfterUpdate event and choose:

[Event Procedure]

Then click on the ellipses button at the end of that line and it will open
with the code stub already filled in. Simply paste in the line:

Me.txtMyText.Format = "hh:nn"

The use the Debug menu to compile the database. Click on the save button and
your done. Close, then open the form back up and the code should work.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Time format in a statement 8
Chinese + Russian miitary to replace Microsoft products. 2
2 digit year 8
Reformat Time 5
Time Format 1
Inputting Time 2
24hrs time difference 6
time format 3

Back
Top