Time formt

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
 
A

Arvin Meyer

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
 
A

Arvin Meyer

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
 
Top