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
Solved

Generating Numbers in Data Report

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

809 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