473,396 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

generating serial no upon datareport

can anybody tell me how should i generate serial no in datareport
i have written a code for retrieving rows from a table .
but i want it should generate sr no also .
suppose

SRNO PRODUCTNAME qty unit
1 lenova lapto 10 pcs
2 IBM LAPTOP 20 "
3 ACCR LAPTOP 50
4 TOSIBA LAPTOP 10

kindly help me

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Command4_Click()
  3. Dim mr As Integer
  4. mr = InputBox("enter a mr no")
  5. Set rs = New ADODB.Recordset
  6. rs.Open "select * from MR where req_no = " & CStr(mr), con, adOpenDynamic, adLockOptimistic
  7. If Not rs.EOF Then
  8. With DataReport2.Sections("section1").Controls
  9. .Item("text1").DataField = rs.Fields("productname").Name
  10. .Item("text2").DataField = rs.Fields("qty").Name
  11. .Item("text3").DataField = rs.Fields("unit").Name
  12.  
  13. End With
  14. Set DataReport2.DataSource = rs
  15. DataReport2.Orientation = rptOrientLandscape
  16. DataReport2.Refresh
  17. DataReport2.Show vbModeless
  18. End If
  19. End Sub
  20.  
Jan 7 '09 #1
3 3034
Frinavale
9,735 Expert Mod 8TB
You need to create a mathematical algorithm to create a serial number.
See what wikipedia has to suggest about serial number arithmetic.
Jan 13 '09 #2
debasisdas
8,127 Expert 4TB
if you are using oracle as your database, can use rownum as serial number
Jan 14 '09 #3
Sir i am using MS ACCESS 2003 As a database .
Jan 14 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: berthelot samuel | last post by:
Hi everyone, I am currently trying to write a report based on a View of SQL Server. Basically, I have 3 tables : Hardware, SoftwareInstalled and Software with SoftwareInstalled that keeps track of...
3
by: collinm | last post by:
hi i send a command to a led display, the led display is suppose to return me some character i write a string on a serial port void ledDisplayExist() { char msg={'\0', '\0', '\0', '\0',...
7
by: davetelling | last post by:
I'm a newbie that is still struggling with OOP concepts & how to make things work they way I want. Using Visual C# Express, I have a form in which I added a user control to display a graph, based...
5
by: anoopgopal007 | last post by:
Hi, I am using vb6 and datareport. I am updating the tables whle the program running. But the datareport doesnot show the updated information. Its always shows the previous value. But...
6
by: pramodrepaka | last post by:
hi this is pramod i am facing a small problem Private Sub Command_Click() Dim a As String a = InputBox("enter empno") If rs.State = 1 Then rs.Close rs.Open "select * from microbiology...
5
by: Neelesh2007 | last post by:
Hi all. I want to add serial Number to Rows of my datareport in VB6.0 Can anybody give me a sample code? Thanx in advance.
0
by: swamimeenu | last post by:
Hi, I need to add a automatic serial number in datareport in vb without having tht field in database.. but the remaining fields are connected from db... how to generate automatic serial number...
6
by: terry | last post by:
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send...
1
by: MaryKJolly | last post by:
I got this sample project from a website. But there is some syntax error in the statement which contains the CDate function. I can't detect the error? Can enybody help me? SUMMARY This article...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.