|
-
May 3rd, 2009, 08:14 AM
#1
Thread Starter
New Member
Adding Values
Hi guys,
First of all I want to say Hi to everyone as I'm a new member and then second I want to applogize if I posted this at the wrong section.
Ok basically I've created a database in MS Access with a list of prodcuts with a corresponding price and a Yes/No column at the end. I've imported the database in VB (I'm using VB 2008) and I've put a textbox. What I'm aiming for is basically when I tick one or more products on the database, the prices to be added in textbox. I'm guessing I will need to build an expression but I have no clue how to do that. Can anyone help out?
-
May 3rd, 2009, 10:02 AM
#2
Thread Starter
New Member
Re: Adding Values
Please people, its URGENT!
-
May 3rd, 2009, 01:47 PM
#3
Re: Adding Values
Welcome to VBForums 
Please do not bump your threads. For some of the reasons, see this. People will read your thread (and hopefully reply) when they get the time to do so.
For now the best I can do is recommend you spend some time reading our Database Development FAQs/Tutorials (at the top of the this forum), particularly the VB.Net section. You may also need to check out the SQL section.
-
May 3rd, 2009, 08:10 PM
#4
Re: Adding Values
Are you saying that you don't know how to get the data from the Access database into your application? When you say that you've "imported" the database, do you mean that you've just added it to your project or have you used the Data Source wizard to generate a typed DataSet?
-
May 4th, 2009, 05:26 AM
#5
Thread Starter
New Member
Re: Adding Values
 Originally Posted by jmcilhinney
Are you saying that you don't know how to get the data from the Access database into your application? When you say that you've "imported" the database, do you mean that you've just added it to your project or have you used the Data Source wizard to generate a typed DataSet?
No, no, no. I didn't make myself very clear and forgive me for that. I have the database on the form and when I run the program its there but what I need to do now is when I tick a given product on the database, the corresponding prices to be added in the textbox I've created on that form. Take a look at that screenshot I've uploaded and you'll get a better idea of what I'm aiming for
-
May 4th, 2009, 06:10 AM
#6
Re: Adding Values
How exactly did you get that data displayed? Did you populate a DataTable and then bind that to a DataGridView? If so, did you put a BindingSource between them?
-
May 4th, 2009, 06:26 AM
#7
Thread Starter
New Member
-
May 4th, 2009, 08:42 AM
#8
Re: Adding Values
OK then. You should handle the CurrentItemChanged event of the BindingSource, which is raised every time a field in the current record is changed. In that event handler you can loop through all rows and simply add up the ones where your Yes/No column is True. The result goes in the TextBox.
-
May 4th, 2009, 08:48 AM
#9
Thread Starter
New Member
Re: Adding Values
I seriously have NO clue how to follow all these steps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|