Solved

assigning 0 to a textbox problem

Posted on 2004-08-11
5
295 Views
Last Modified: 2010-05-02
I fill in a text box 9txt_textbox) with a variable (var_textbox)
using this function.

txt_textbox = Format(var_textbox, "####.#")

The variable var_textbox is declared as single.

Now my problem. If the variable is set to zero , than on the screen it comes up with an entry like

  .     That means a single dot is visible in the textbox.
How do I have to programme to show actuakky the 0 value?  Or I would not mind neither an empty textbox with no dot at all instead
0
Comment
Question by:themroc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Expert Comment

by:zULu
ID: 11770956
if var_textbox=0 then
    txt_textbox = 0
else
    txt_textbox = Format(var_textbox, "####.#")
end if
that should do it
0
 
LVL 4

Accepted Solution

by:
hamood earned 100 total points
ID: 11771003
Use this one
txt_textbox = FormatNumber(var_textbox, 1)

it will disply value like 0.0
0
 
LVL 6

Expert Comment

by:mmusante
ID: 11771064
Try this ...

Format(var_textbox, "###0.#")

if you want '0.' or this

Format(var_textbox, "###0.0")

if you want '0.0'
0
 
LVL 19

Expert Comment

by:Shauli
ID: 11771446
txt_textbox = IIF(var_textbox = 0, 0, FormatNumber(var_textbox, 1))

S
0
 

Author Comment

by:themroc
ID: 11771485
I think hammod gave the most appropriate answer, this really solve the problem and because it is tied in a way to the country setting in fact it solves other issued I HAD TOO!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question