Solved

Generating Numbers in Data Report

Posted on 2002-04-08
5
148 Views
Last Modified: 2010-05-02
Hi all,

 I am generating a report in Data Report, with back end datas from Access 2000. I am selecting according to a queries...In the Data report to be shown i wants to print numbers automatically like 1,2.......10...and so on  to the end of the report according to the number of records returned by the query..

1) How can i do that in VB code..
2) is that possible to add a report function in detail section..

please answer me these  question with better solution

Thanking u all

Regards

kumar...
0
Comment
Question by:techguy007
[X]
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
5 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6927366
You will have to include this counter in the recordset used by the data report. One way to achieve this is to append the results of your query to a temporary table with the same structure as your recordset, but with one additonal column defined as AutoNumber.  You can then design the report based on this temporary table.

There are other ways, but this is the easiest to follow.

Anthony
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 6927371
Hi techguy007,

1. Use the Unique ID (Primary Key), for example a Auto increment Field an do it as follow:

Example:

Select (Select count(*)+1 from Table1 b where
b.PrimaryKey < A.PrimaryKey) As SerialNumber, a.UserName, a.Age, a.JoinDate from Table1 a

2. Detail cannot include report function, but you can define your function in your SQL, then use it as a field.

Example:

Select ((A + B)/C * 256) As Total From Table Where C > 0

regards

0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 75 total points
ID: 6927727
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7643073
Hi techguy007,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept emoreau's comment(s) as an answer.

techguy007, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7673298
Moving to the PAQ

kb
Experts Exchange Moderator
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month8 days, 6 hours left to enroll

615 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