×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Length of a bound numeric textbox

Length of a bound numeric textbox

Length of a bound numeric textbox

(OP)
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?

RE: Length of a bound numeric textbox

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:www.crowncap.demon.nl\info\crwnbase
CrownBase source code can be downloaded !!

RE: Length of a bound numeric textbox

(OP)
...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?

RE: Length of a bound numeric textbox

Check the MSDN for the difference.

BTW what version of VFP are you working in ?

HTH,

Weedz (Wietze Veld)
My private project:www.crowncap.demon.nl\info\crwnbase
CrownBase source code can be downloaded !!

RE: Length of a bound numeric textbox

(OP)
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.

RE: Length of a bound numeric textbox

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:www.crowncap.demon.nl\info\crwnbase
CrownBase source code can be downloaded !!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close