Percent Format using code

  • Thread starter Thread starter dear_ro
  • Start date Start date
D

dear_ro

Guest
I searched everywhere for a solution to my problem. I have to create a field and set its format property to Percent using code. I know how to create the field using code but how do i get to Format property? Is that possible?
Thanks in advance for your answers!
 
similar question

i've had the same problem myself. i used a module to code my own data type, but was unable to apply it. any suggestions are appreciated. ;)
 
This may vary slightly based on what you are assigining, but here's the rough view:

If the number you are assigning is something like .0423, then using this:
Code:
strMyPercent = Format(strMyPercent, "Percent")

would generate strMyPercent which would show as 4.23%

If you have the numbers like 44.5, then you would need to divide by 100 before assigning the value to the string.
 

Users who are viewing this thread

Back
Top Bottom