472,965 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,965 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 9296
NeoPa
32,547 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,547 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:...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.