Solved

serial no in datareport

Posted on 2000-05-16
3
265 Views
Last Modified: 2010-05-02
how can i create serial no(1,2,3...) for each item in detail section?.How can i call a function in datareport? I am using sql statement to create group and detail.
0
Comment
Question by:shyma
[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
  • 2
3 Comments
 

Accepted Solution

by:
Visual_Basic_ earned 20 total points
ID: 2828021
I had the same problem. This I have done is to open the recordset programmatically and set the field's value to its line number.

I did it via ADO.
I had an empty table. There were only the fields.
I filled it with a "Insert" query, which was filling one field with "0".
I named this field "RowCount".

Then I did so:

DE1.rsMyTable.MoveFirst
While DE1.rsMyTable.Eof=False
DE1.rsMyTable.fields("RowCount").value=DE1.rsMyTable.AbsolutePosition & "/" & DE1.rsMyTable.RecordCount
DE1.rsMyTable.Movenext
wend

I filled the "of xx"
e.g. The field was 0 and I did it "1/20","2/20","3/20"... and so on.

If you have trouble simply mail me.

0
 

Author Comment

by:shyma
ID: 2828289
I'm using sqlbuilder to select fields from different table.Is there any way to create serialno using sqlbuider.something like count(rowid) in oracle.As per visual basic reply ,are you creating a table to hold all values to be shown in datareport.
Okay then what you have written something like "of xx".   I don't understand.Can you explain me in detail?
0
 

Expert Comment

by:Visual_Basic_
ID: 2828822
I don't know about Oracle. In Sybase there is a system variable called @@rowcount. It returns the number of line.

When I say "...of xx" I mean that when I replace the zero values in the field "Rowcount" I add the line of the record and the total number of rows.

Like when you are printing and it says "Page 1 of 3"

In my first reply I replaced the word "of" with the slash "/". No matter, if you follow these instructions you can add everything. It's a string field, not a numeric one.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

734 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