473,394 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ComboBox Columns & Blanks

37 32bit
A ComboBox with five columns, three of them are numeric in a Table. The ComboBox shows the Columns as numeric (1,200.00), but when the TextBox shows the value, it drops the coma (1200) and the decimal. Do care about the decimal because in the table the numbers are formatted as a numeric whole numbers.

The problem I'm having is trying to get the coma to appear when it should (1,200) it does appear in the column. I have tried to format the values in the Combobox Row Source Select statement like this,
Expand|Select|Wrap|Line Numbers
  1. Format(tAmmo.GrossQty, "#,###") AS ["GrossQty"], Format([tAmmo].[TargetLevel], "#,###") AS ["TargetLevel"] 
and it does add the coma, but then it creates another problem and that is when a zero value should show the textbox is blank and the my calculation get all missed up because it's blank. It even changes the zero value to a blank when looking at columns on the ComboBox.

Everything works like it should until a textbox gets a blank instead of a zero. I've spent two days on this and now I need some help.

How do I force a zero when the column forces a blank, all this because I placed a numeric format in the select statement?
Sep 16 '22 #1

✓ answered by NeoPa

Hi Curious.

Your format strings ("#,###") all say "Give me a string with commas where necessary (>3 digits) but don't show columns unless they, or something to the left, is >0. Oh, and by the way, don't show decimals either.".

If you want zero values to show as 0 then use "#,##0", and if you also want two decimal places to be included regardless then use "#,##0.00".

3 9974
NeoPa
32,556 Expert Mod 16PB
Hi Curious.

Your format strings ("#,###") all say "Give me a string with commas where necessary (>3 digits) but don't show columns unless they, or something to the left, is >0. Oh, and by the way, don't show decimals either.".

If you want zero values to show as 0 then use "#,##0", and if you also want two decimal places to be included regardless then use "#,##0.00".
Sep 17 '22 #2
Curious27
37 32bit
Hi, how are you?

I was so close and yet so far way, all because of a zero.
Makes sense though, how can you plea for a zero if you don't ask for one.

Thanks again, my friend.
Sep 17 '22 #3
NeoPa
32,556 Expert Mod 16PB
Hi Curious.

I'm good thanks :-)

It looks like you're learning as you go, which is progress. All progress is good. One tip I would give you, is to see if the Help page can tell you what you need to know first. It's what I use, even now, in many scenarios.

Sometimes it's hard even to know which one to look at. In this case you probably didn't even appreciate it was a number formatting problem until later, but once you do then a look at the Help page often helps solidify the understanding - as well as often giving extra information about something you might never otherwise have guessed.
Sep 17 '22 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: JAdrianB | last post by:
I'm trying to use a datagrid for data entry. I've created a couple of combo box columns using information from http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q480q That example basically sets...
0
by: Rudolph Araujo | last post by:
Hi, I needed to build a data grid in which the first column has hyperlinks rather than simple text. I found the following code on this newsgroup and it works fine except for one problem. When I...
1
by: fiaolle | last post by:
Hi I have a DataGrid with ComboBox columns. I want the same thing to happen as when a user clicks and chooses an item in the ComboBox. When a user stands in the last row (new row) and clicks for...
3
by: =?Utf-8?B?TTFpUw==?= | last post by:
I have a GridView control with a template column that I use to display my record data. I’ve included an EditItemTemplate with textboxes bound to the GridView for editing. On my SqlDataSource I...
4
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
I am trying to populate a DataGridView Combobox column with a different data binding source (dataset) depending upon a selection made in a previous column. I can handle the previous column but how...
1
by: alexmax2003 | last post by:
That quotation was add b4 i need to know from VB.Net wizards The answer "I'm trying to use a datagrid for data entry. I've created a couple of combo box columns using information from...
1
by: leiger | last post by:
Hi, I need help with this problem as soon as possible (within a couple of days). This is the first time I have ever used Access 2007 and therefore I am having some problems - especially as I...
0
by: arunpandey | last post by:
Friends I am creating columns and edit button in ASP.NET DataGrid at Run Time but when I click on the Edit Button disappears all columns and edit button itself. Only one column remains stay back,...
0
by: Curious27 | last post by:
Back again... I'm trying to calculate two TextBoxes which contain a values from a ComboBox Columns. TextBox1 - txtQty (Control Source: equals .(3) TextBox2 - txtPicked (Control Source:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.