Forcing a Format

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

Is there any way to force a Medium Time format on a Unbound field? So
even if the inputer puts something off it'll force it to the correct Format?
Thanks
DS
 
Try setting the Input Mask (Data tab) to Medium Time. This will also force
the users to enter the data in that format.
 
Wayne said:
Try setting the Input Mask (Data tab) to Medium Time. This will also force
the users to enter the data in that format.
I have it set to medium time but a message box pops up if you try to
complete the transaction. They are inputing the time from a popup form
after they enter the time:
1:00 AM (Perfect)
100 AM (Not Good)
1:AM (Not Good)
etc....

I want the time to correct itself, even if they enter a (Not Good)
This form closes and it goes into the field on the main form.

Thanks
DS
 
To have the time correct itself, you're going to have to catch every
possible combination of errors and change the time to what you think they
meant.

The input mask should prevent them from doing it wrong, and yes, it will
complain if they do it wrong. The advantage is that the input mask can also
put place holders in the textbox to guide them to doing it right to begin
with. The second step of the wizard for creating the input mask will give
you a choice of characters for the prompt. If they still insist on doing it
wrong, then after doing it wrong a couple of times they'll learn to do it
right the first time and the problem will go away.
 
Wayne said:
To have the time correct itself, you're going to have to catch every
possible combination of errors and change the time to what you think they
meant.

The input mask should prevent them from doing it wrong, and yes, it will
complain if they do it wrong. The advantage is that the input mask can also
put place holders in the textbox to guide them to doing it right to begin
with. The second step of the wizard for creating the input mask will give
you a choice of characters for the prompt. If they still insist on doing it
wrong, then after doing it wrong a couple of times they'll learn to do it
right the first time and the problem will go away.
Thank You, I'll try the input wizard. I'll let you know how it works out.
DS
 
I'm assuming by 'unbound field' you mean a text box on a form tha
isn't linked to any control source

In this case you can set the 'Format' property of the text box t
'Medium Time' and that should do what you want - shouldn't requir
any code or anything

Note that the formatting will be the same as a 'Medium Date' in
table would be, thus things like

13.0
1 p
13p
13.

Will work, but some things like

1
130


Won't work; I don't see any realistic way to catch every possibl
input a user could enter because in theory they might right "ONE PM
- you'd need to consider everything they enter - setting the forma
of the text box as Medium Time should be a good starting poin
though
 
Pringle9984 said:
I'm assuming by 'unbound field' you mean a text box on a form that
isn't linked to any control source.

In this case you can set the 'Format' property of the text box to
'Medium Time' and that should do what you want - shouldn't require
any code or anything.

Note that the formatting will be the same as a 'Medium Date' in a
table would be, thus things like:

13.00
1 pm
13pm
13.0

Will work, but some things like:

13
1300
1

Won't work; I don't see any realistic way to catch every possible
input a user could enter because in theory they might right "ONE PM"
- you'd need to consider everything they enter - setting the format
of the text box as Medium Time should be a good starting point
though.
They are entering the Times from an Onscreen Number Pad....Numbers only.
I also have an AM/PM button...
So they would touch
Button 1 and get 1
then Button: 1:
then Button0 1:0
then Button0 1:00
then ButtonAM 1:00 AM thats _AM
They would build the time this way and hit done...
this would then be transfered to the bound field containing the time
with a Medium time Format.
But of course...I'm sure mistakes will be made,,so I want to force the
format,,they are pretty limited to their mistakes.
Thanks
DS
 
Back
Top