473,287 Members | 1,616 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,287 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 9965
NeoPa
32,554 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,554 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:...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.