Form Textbox Suffix

  • Thread starter Thread starter Deleted member 73419
  • Start date Start date
D

Deleted member 73419

Guest
Hi,



Is there a way to have a textbox suffix like in the same way Excel has custom numbers to append a letter or number to the end of the contents of the textbox but is not actually part of its value?


Thanks
 
Can you demonstrate? I am not sure I am following...
 
Are you referring to formatting the control so that e.g. 1234 can be displayed as 001234 or as 1234abc or similar?
 
Are you referring to formatting the control so that e.g. 1234 can be displayed as 001234 or as 1234abc or similar?


Yes, this is exactly what I'm referring to :D


For instance, I could enter any number and it will add "kg" to the end ie I enter 123 and the textbox will display 123kg. But when I use the value of this textbox in a calculation, its value is 123.


In comparison, I can add a number number format of '0.00"kg"' to a cell and enter 123 and the cell will display 123kg...
 
In the format property of the textbox, enter something like 0.00" kg"
This will automatically add 2 d.p. followed by a space then kg
e.g. 2 => 2.00 kg, 12.5 =>12.50 kg etc

Is that near enough for your needs?
 
Or even simpler..you can add a small Label to the right of the Textbox that says "kg."

It has the added advantage of reminding the user of the unit of measure that is to be entered.

Linq ;0)>
 
In the format property of the textbox, enter something like 0.00" kg"
If the control is bound, it cannot be a calculated control, no? (and that includes concatenation) I'm surprised no one asked (or did I miss it?)
But when I use the value of this textbox in a calculation, its value is 123.
You would have to extract the numeric portion because the true value or text of the control is 123 Kg, not 123.

IMHO, the whole idea goes against the most basic fundamentals of normalization IF the intent is to store the contents in a table as 123 Kg ; at least if the numeric part is ever meant to be used or stand alone.
 
Whilst I would also use a unit label as Linq suggested, formatting the form control as in my reply does not affect what is stored in the underlying field.
So when 12.50 kg is displayed, the stored value is 12.5 and can be used in a calculation without any additional work. For example:


attachment.php
 

Attachments

  • Capture.PNG
    Capture.PNG
    12.3 KB · Views: 625
Last edited:
you format form controls in the same way you do in excel - using the control format property option as colin suggests (rather than in excel where format property option is in the ribbon). There are some differences between the options available
 
Colin - thanks! Obviously I have never tried that!
 
Hi,
Is there a way to have a textbox suffix like in the same way Excel has custom numbers to append a letter or number to the end of the contents of the textbox but is not actually part of its value?
Thanks
I would concatenate them together to visually represent something new, and not save the contrived new value.
 
one of the things you can do with access formatting which cannot be done in excel (so far as I am aware) is format for null and display some text

for strings it is

@;"Enter something here"

for numbers (depending on number format required for positive, negative, zero aka excel)

#;#;#;"Enter something here"
 
I would concatenate them together to visually represent something new, and not save the contrived new value.

Formatting is being used to represent value and units. There is no contrived new value as the data is unchanged
 
Don't confuse Format property setting with Format and FormatNumber functions. Format property does not change the stored value whereas a value modified with function is no longer the stored value. The functions return a string.
 

Users who are viewing this thread

Back
Top Bottom