textboxes for numeric data

arm1

Registered User.
Local time
Today, 18:20
Joined
Nov 21, 2006
Messages
40
I have a textbox that is unbound.

When a user selects an item from a separate (also unbound) drop-down list, I associate the .column(1) data to this textbox.

The issue is that the value is numeric.

When I try comparing the value to a number X != X because one X is an actual number, while the other X is in text format.

The other issue is this:

This textbox that contains a number... I want there to be a leading 0. For regular numeric fields, this would simply be a matter of setting the format property to '00', then if the value is 3, it would appear as 03.

Obviously, since this textbox is formatted for text, it only displays 3, not 03.

As a solution to the first part, instead of using

If (textbox1.value = field2.value) then

I can use

If (CInt(textbox1.value) = field2) then

This then properly compares a number with a number... but it does not solve the leading 0s issue.

Thanks for any help,

- arm1
 
This textbox that contains a number... I want there to be a leading 0. For regular numeric fields, this would simply be a matter of setting the format property to '00', then if the value is 3, it would appear as 03.

Obviously, since this textbox is formatted for text, it only displays 3, not 03.
I just did a quick test and it appears there's nothing stopping you from setting the format property to '00' for a text box - and in my test, it inserted a leading zero.

Maybe I'm not understanding the problem properly - why can't you format it as '00'?
 
Good question.

I too put '00' the Format property of this field... but running the form again seems to have changed nothing?

I tried '000000' just to see... nothing.

It keeps the value as 2... not 02... nor 000002.

I don't understand why... I just figured it was something to do with it reading the field as text, not a number?!?!?
 

Users who are viewing this thread

Back
Top Bottom