How do I hide data in a text box

A

Al

I have a text box control on a form that is tied to a 3-digit number (010).
The first digit is always "0". I would like to hide this leading digit from
the user.

Users will enter data in this field. I would like them to enter only
2-digits on the form but have that store as the 3-digit number.

I have played with masks in the Format Property like "#0", "0","0#".
Nothing seems to work.

How can I accomplish this?
 
O

Ofer Cohen

On the before update event of the field you can write

Me.[TextBoxName] = Format(Me.[TextBoxName],"000")

So the user will enter 2 digits, but it will add to it a leading 0
 
A

Al

OK, that sound like that will work for the update part.

How do I get the text box to only display the last two digits all the time,
when the field associated with the text box is a 3-digit field?

Ofer Cohen said:
On the before update event of the field you can write

Me.[TextBoxName] = Format(Me.[TextBoxName],"000")

So the user will enter 2 digits, but it will add to it a leading 0

--
Good Luck
BS"D


Al said:
I have a text box control on a form that is tied to a 3-digit number (010).
The first digit is always "0". I would like to hide this leading digit from
the user.

Users will enter data in this field. I would like them to enter only
2-digits on the form but have that store as the 3-digit number.

I have played with masks in the Format Property like "#0", "0","0#".
Nothing seems to work.

How can I accomplish this?
 
O

Ofer Cohen

The problem with displaying the data with no leading zero, is that you wont
be able to update this field.

To remove it
=Val([FieldName])

So you can use it in a query for display purpose.

--
Good Luck
BS"D


Al said:
OK, that sound like that will work for the update part.

How do I get the text box to only display the last two digits all the time,
when the field associated with the text box is a 3-digit field?

Ofer Cohen said:
On the before update event of the field you can write

Me.[TextBoxName] = Format(Me.[TextBoxName],"000")

So the user will enter 2 digits, but it will add to it a leading 0

--
Good Luck
BS"D


Al said:
I have a text box control on a form that is tied to a 3-digit number (010).
The first digit is always "0". I would like to hide this leading digit from
the user.

Users will enter data in this field. I would like them to enter only
2-digits on the form but have that store as the 3-digit number.

I have played with masks in the Format Property like "#0", "0","0#".
Nothing seems to work.

How can I accomplish this?
 
Top