Solved

Generating Numbers in Data Report

Posted on 2002-04-08
5
146 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 51

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

Technology Partners: 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

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…
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 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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 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