Create counter in VB6 DataReport

Posted on 2003-03-11
Medium Priority
Last Modified: 2008-03-17
I prefer to use VB6 built-in DataReport to create reports from my database, however I couldn't find any help on how to create counters for my reports.

As an example I wanted to produce reports like:

item id product
---- -- -------
1    01 keyboard
2    02 mouse
3    04 monitor

I can fill the id and product field with data from database, but how do I generate the item counter?

Question by:myShanai
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

ID: 8115965

I Real do not understand quite well of what you want, cause my english is not very good, but i think that you want a a counter for each report of each item, if this is the case, why don't you put in your database the counters for each item?
For instance if you have 3 Items, as above, Keyboard, Mouse and Monitor, you can create fiels Counter1 for Keyboard, Counter2 for Mouse and Counter3 for Monitor.
Each time you open a report just update your field counter.
Other way that i have made for a statistics reports, is to create a new table CounterReports, with fields of each reportname, and update the fields. Ex:

data1.recordsource = "CounterReports"     'Mytable counters
data1.recordset.absoluteposition=0       'My Unique Record
data1.recordset.fields(1)= = data1.recordset.fields(1)+1  'Keyboard
data1.recordsource = "Table1"       'Return to my original table

Now in your report you can make a field indexed to counterreports field(1), and have tour value counter ofr each report.

Hope it helps you


Author Comment

ID: 8117032
What I meant was not a counter to count how many keyboard,mouse or monitor. But instead, like a numbered list, or may I re-phrase it as record numbers.
For an example, if I search for products from the "computer" category, the reports will display a list of items such as:

item id product stock
---- -- ------- -----
1    01 keyboard 20
2    02 mouse    35
3    04 monitor  19
4    08 cd drive 24

This actually can easily be done if we use Crystal Reports, which is by inserting "record number field".
But VB6 Data Report doesn't have that feature.

Expert Comment

ID: 8145297
Sorry I can't Figure the Way.

Expert Comment

ID: 9474557
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Accepted Solution

myShanai earned 0 total points
ID: 9491287
I think there is no way VB6 could do that within it's built-in data report.

The solution is to use Crystal Report instead. Thanks for those who tried to help me.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question