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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change how Long Date is displayed

Status
Not open for further replies.

geralf

Technical User
Apr 7, 2003
44
MX
Hi,

I have a field which has it's default set to =Now(). The format is set to Short Time.

So the data is displayed as this ie: 16:15

If I clic in the field to edit the date/time-field, I get to see the Long date format ie: 07.03.2003 16:15:04

When I click in the field I would like to have it to show 07.03.03 16:15

Is this possible?

Thanks in advance for any help.

Gerhard
 
You could try setting your default value to:

Format(Now(),"Short Time")
 
Yes. it's already set to Short time as described in my first post. It's when I click in the field to edit it I see the 'Full datr/time'. I'd like to see only two numbers for the year, ie 03 instead of 2003 and that the seconds are dropped from the time, so that the time part show as ie: 16:15 instead of 16.15:07.

Thanks for your reply though.

Gerhard
 
Actually, my suggestion referred to the default value property and not the format property of the field. I also had originally thought you were referring to the default value at the table level and not the form level. However, I'd missed the part about wanting to display the short date AND short time when you click in the field. My suggestion only works if you want to display the short time alone. I couldn't get it to work for date AND time.

Sorry about that.
 
This 'easy' hing seems to be impossible to do.

The table field data type is set to Date/Time. No format set in table.

In the form Format Property of the field I use Short Time, and the input mask property set to: 00.00.00 00:00

In the GotFocus event of the field I use the following code to insert the date/time:
Private Sub Date1_GotFocus()
If IsNull(Me.Date1) Then
Me.Date1 = Format(Now(), "dd.mm.yy hh:nn")
End If
End Sub

So when the field gets focus, I get the time displayed ie: 18:05

If I now click in the field to edit it, I get the 'full date/time' ie: 08.04.03 18:05:00

I've managed to shorten the year down to two digits by using Regional Settings/Deselect 'use 4 digits for Year' in Access (under Tools->Options -> General Tab. I had however no success with removing the seconds from the clock in Regional settings.

In the table the date/time shows: 08.04.03 18:05:00

Any help on loosing the seconds part of the time when the field is beeing edited will be greatly appreciated.

I need to keep the data type as a date/time type.

Regards
Gerhard





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top