I have a txtbox with the time in it as the default and the user can edit it. It currently has the hour, min, sec. Is there a way to get rid of the seconds so that the user doesn't see it?
This will display just hours and minutes, in 24-hour format. If the user types a time which includes seconds, Access will remove these, e.g. 12:01:20 will be displayed as 12:01.
For a bound field, set the format of the underlying table column to be 'short time' as well. This will make sure that the time is always stored and displayed as hours and minutes only.
Thanks I already have short time. The problem is that it displays only hours and minutes but when the user clicks on it to modify the seconds pop up. My users are finding this to be very annoying.
I tried hh:mm but it just changed it to short time. Is there anything I can do?
I checked in my test form, and I found the same problem if the underlying table data contains seconds information. To achieve the 'hours and minutes only' effect, you need to:
-- Set short time as the format for the bound column in the table
-- set short time format for the field on the form
-- make sure there is no existing data in the table which contains seconds values. You could use an update query to force the existing data to hh:mm format, e.g.
update [MyTimeField] to:
format$([MyTimeField], "hh:mm")
When I did all three steps, I saw hours and minutes only.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.