Solved

Generating Numbers in Data Report

Posted on 2002-04-08
5
141 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
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 49

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 69

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now