Good Day to all Expert I've been developing a program in visual basic 6.0 for my mother, I'm building a Database for the Information Records. My Problem is i can't continue my project , im stuck on calculations of this area. So im posting here maybe somebody will help me for this. I've attach an image here please open it to see the image. I'm using a DBgrid to see contents populating from my Database Table using MS-Access. The image above is only an example which i have to make in VB soon. I need a code for calculating this Example: RETURN + RETURN + RETURN and so on.. = Total in Textbox New + New and so on... = Total in textbox Note: Im not using a Number for this Im using a word/string. Eg. Return etc. Thanks in advance Regards Neil
as i understood your problem, you have a certain list of categories. and in the list, the same item can be there n times, and you need to calc the no. of ti,es of each of the category? first your given data is not really sufficient i mean, first, can you iterate the list? i mean are you done with the part where you can go through each item of the list? if so there are several methods to solve your problem 1. you cna simply put some switch cases, which will see what the string is and update integer counter accordingly 2. the more professional way is that you make a list of key/value pairs [hash maps, lists]. make the pair as <string, int> where the key is category name, from there on it is just increasing the int value relevant to the String key
Thanks for replying. I appriciate very much Can you give me the specific code to calculate Regards Neil