Forum Discussion
Jqws13_
Mar 20, 2022Copper Contributor
Minutes and Seconds Field
Hi everyone, somewhat new to the world of access, and I have run into a seemingly simple problem, that I cannot find an answer to online. How can I create a field, with the format minutes and seconds...
GustavBrock
Mar 20, 2022MVP
That is correct. Even worse, on a new record, 00:00 will be displayed, but - even worse - if you enter, say, 48:37, Access will report "Invalid date", as the entry will be parsed as hh:nn.
Your best option is probably to use two juxtaposed textboxes holding minutes and seconds respectively, and assemble these with TimeValue(0, n, s) to build the time in the BeforeUpdate event of the form, and use Minute([TimeField]) and Second([TimeField]) to display the time using the OnCurrent event of the form.
Ultimately, create a form using Inputmask and custom code similar to what I did here:
Entering 24-hour time with input mask and full validation in Microsoft Access
- isladogsMar 20, 2022MVPIf you enter e.g 0:48:37, it will be correctly displayed as 48:37
- GustavBrockMar 20, 2022MVPBut Colin, entering hours is exactly what the questioneer wants to avoid.
- isladogsMar 20, 2022MVPHi Gust
You may well be right but the OP didn't actually say that.
I was just trying to point out that the data entered doesn't have to be displayed in the same format.