[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

assigning 0 to a textbox problem

Posted on 2004-08-11
5
Medium Priority
?
299 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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 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