473,385 Members | 1,546 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,385 software developers and data experts.

Calculating ComboBox Columns

37 32bit
Getting the values from a ComboBox's columns works to fill in a TextBox but can't get the results from a calculation in another TextBox. I don't know why I get an #Error in TextBoxes 3-4 unless the value from a column is not a true numeric value but a string value and if so, how can it be converted to a numeric value for calculation?

Here is what I have.
TextBox1 - txtQty (Static quantity from ComboBox column-3)
TextBox2 - txtPicked (Quantity from ComboBox column-4)
TextBox3 - txtActQty ( Calculated - [txtQty]-[Picked])
TextBox4 - txtTarLevel (Stock target quantity from ComboBox column-5)
TextBox5 - txtLoadQty (Calculated - [txtTarLevel] - [txtActQty]

Open to any suggestions.
Sep 1 '22 #1

✓ answered by NeoPa

Curious27:
Why would the "Sum" cause the error?
That is so very hard to answer as you provide no context. I will try.

Sum() works specifically with sets of data. It essentially means (in this case) to calculate [Qty]-[Picked] for one record and add it into a total, then keep making the same calcuulation for each record in the set and repeatedly adding the result into a total value that is passed back as the result. Nowhere do you mention any sort of set of data so my guess is you don't have one - which is why it's confused.

If you do have a set of data to work on then not including that information in the question is very hard to understand.

As for finding your question again once you've posted it, there are two things to bear in mind :
  1. Posts by most users now are being sent directly to the moderation queue rather than forum itself. Moderators, such as myself and others, get notified of this and decide to free it into the forum or delete it depending on the contents. Yours are fine but still have to be moderated first.
  2. I use Subscriptions to find and show me all my subscribed threads. Even with over twelve and a half thousand of them this works for me. Very few stay active for a long time and that link sorts them by recent activity.
NB. The link I provided will take any member to their own set. It's not specific to my account.

3 9378
NeoPa
32,556 Expert Mod 16PB
Curious27:
Getting the values from a ComboBox's columns works to fill in a TextBox but can't get the results from a calculation in another TextBox.
I would say the first, and most obvious, question - or request - is for the actual formulas used.

It's possible to work in the dark but I see no reason why it might make sense.

I wouldn't expect any reference to a ComboBox's .Columns() Method to work outside of a VBA environment.
Sep 1 '22 #2
Curious27
37 32bit
Hi NeoPa

I worked on this for hours, then after posting my question it did not appear and the next day it still wasn't there. I thought I may have exited without actually pressing the button, so I made another post and it to did not appear and I know I press the post button that time.

Any ways I did figure the out the problem which was a calculation error that I place in the Control Source for TextBox 3-5. Since this was my first time using ComboBox Columns to fill in Textbox's I thought the Error I was getting was from the values they were filled with. As I stated I did figure it out and I am still confused as to why the Error. Here is my calculation I placed in the Control Source for TextBox 3-5 which did not work.

Gives #Error:
Expand|Select|Wrap|Line Numbers
  1. =Sum([Qty]-[Picked])
Works:
Expand|Select|Wrap|Line Numbers
  1. =[Qty]-[Picked]
Why would the "Sum" cause the error?
Sep 2 '22 #3
NeoPa
32,556 Expert Mod 16PB
Curious27:
Why would the "Sum" cause the error?
That is so very hard to answer as you provide no context. I will try.

Sum() works specifically with sets of data. It essentially means (in this case) to calculate [Qty]-[Picked] for one record and add it into a total, then keep making the same calcuulation for each record in the set and repeatedly adding the result into a total value that is passed back as the result. Nowhere do you mention any sort of set of data so my guess is you don't have one - which is why it's confused.

If you do have a set of data to work on then not including that information in the question is very hard to understand.

As for finding your question again once you've posted it, there are two things to bear in mind :
  1. Posts by most users now are being sent directly to the moderation queue rather than forum itself. Moderators, such as myself and others, get notified of this and decide to free it into the forum or delete it depending on the contents. Yours are fine but still have to be moderated first.
  2. I use Subscriptions to find and show me all my subscribed threads. Even with over twelve and a half thousand of them this works for me. Very few stay active for a long time and that link sorts them by recent activity.
NB. The link I provided will take any member to their own set. It's not specific to my account.
Sep 3 '22 #4

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

Similar topics

3
by: Paul Fairless | last post by:
Customers table - contains Columns: CustID, Surname, Forename, TtlID Titles table - contains Columns: TtlID, Title TtlID is a Foreign Key in the Customers table. I have a Form frmCustomers...
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...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
0
by: zhuang | last post by:
Hi, Adding combobox to datagrid has been posted many times. I have a datagrid which has multiple combobox columns and normal textbox columns. But how could I change other combo box values at...
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...
1
by: Newbie | last post by:
Suppose that I have an HTML table of numbers, and I need to replace the value of each cell with itself divided by the total for that column. The best I can think of is as follows: <xsl:for-each...
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...
0
by: piercy | last post by:
Hi, Im tyring to display a dataGridView with comboBoxes on about 5 of the fields. This table is basically permissions to certain parts of my program. In the database i just store a 1 or a 0 (access...
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:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.