Solved

Generating Numbers in Data Report

Posted on 2002-04-08
5
144 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 50

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

776 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