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

Length of a bound numeric textbox

Status
Not open for further replies.

mpgalvin

Programmer
Feb 5, 2001
119
IE
I have a textbox on my form bound to a db field, N4. However, when I go into the box, I can type *any* amount into it, and having left, it gets turned into extended numbers (1e+14) or worse, *****'s.

I always assumed that if a textbox is bound to a field of a certain length, that's how long the contents of the field can be. Does this still apply to numbers?

Do I have to VALIDate the data, making sure it's not greater than 9999?
 
You will have to set the inputmask and the format property of the textbox to prevent users from typing in numbers higher than the field lenngth.

HTH,

Weedz (Wietze Veld)
My private project:CrownBase source code can be downloaded !!
 
...which brings me neatly to the question of what the difference is between Format and ImageMask? Do I need to set both to #### to show & allow only 4-digit numbers?
 
Weedz, all I can get from MSDN is that the InputMask corresponds to each entry in the input field, where Format affects the whole field.

That's English? ;-)

If anybody knows the difference in plain language, can you let me know?

BTW, I'm using VFP6. I have v7 sitting on my desk, but I'm reticent to install it until I'm sure it's not going to cause any problems for me.
 
You are right, it is a little confusing isn't it..;-)

The inputmask is for entering data, format is the way it is shown in the control.

(correct me if I'm wrong, I am starting to doubt as well).

So for a date, it could be that the input mask shows the century as where the format only shows the 2 digit year..

So when entering, you can enter the whole year (f.i. 2001 inputmask) as where the control show 01 (format).

Just fiddle arund a bit to discover what the difference is, in that respect VFP is sometimes a trial and error language...;-)

HTH,



Weedz (Wietze Veld)
My private project:CrownBase source code can be downloaded !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top