serial number in data report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • indrag91
    New Member
    • Nov 2006
    • 15

    serial number in data report

    i am retrieving 10 records out of 50 records from the access database using dataenvironment based on some condition. Now i want to place the serial number in the data report. Please give ur suggestions.
    Thanks in advance

    indra.G
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by indrag91
    i am retrieving 10 records out of 50 records from the access database using dataenvironment based on some condition. Now i want to place the serial number in the data report. Please give ur suggestions.
    I think we need more information about the situation. For example, what are you referring to as "serial number" here? Is this a field in your database?

    And what environment are you working in? VB6? VB.Net? VBA in Access?

    Comment

    • indrag91
      New Member
      • Nov 2006
      • 15

      #3
      Originally posted by Killer42
      I think we need more information about the situation. For example, what are you referring to as "serial number" here? Is this a field in your database?

      And what environment are you working in? VB6? VB.Net? VBA in Access?
      Sir,
      I have created a database in access and iam using vb as front end. For the data report the data source is dataenvironment .For e.g I have nearly 100 records and i am selecting few records based on a condition in the dataenvironment sql command(select * from contract where vtcno>?) and placing the dataenvironment as the data source to the data reort. The selected records should be numbered(1,2,3. ..) in the data report by adding an additional field in the data report.
      thnaks
      indra

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by indrag91
        Sir,
        I have created a database in access and iam using vb as front end. For the data report the data source is dataenvironment .For e.g I have nearly 100 records and i am selecting few records based on a condition in the dataenvironment sql command(select * from contract where vtcno>?) and placing the dataenvironment as the data source to the data reort. The selected records should be numbered(1,2,3. ..) in the data report by adding an additional field in the data report.
        thnaks
        indra
        Ah! So you want a simple sequential "record number" on the report.

        I'll have to check with some experts who know more SQL than I do, to see whether there's a way to generate it in the query. Will get back to you on that.

        If this is going through VB one record at a time, then you could just increment a counter variable and include that.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          Create an unbound TextBox in the report with
          Code:
          Control Source = "=1" (Lose quotes)
          Running Sum = Over All

          Comment

          • indrag91
            New Member
            • Nov 2006
            • 15

            #6
            Originally posted by NeoPa
            Create an unbound TextBox in the report with
            Code:
            Control Source = "=1" (Lose quotes)
            Running Sum = Over All
            sir,
            ican't understand.plea se tell me where to place. iam getting an error end of statement.
            thanks
            indra

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              Originally posted by NeoPa
              Create an unbound TextBox in the report with
              Code:
              Control Source = "=1" (Lose quotes)
              Running Sum = Over All
              Adrian

              Indra is using a VB front end.

              Mary

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32633

                #8
                Originally posted by mmccarthy
                Adrian

                Indra is using a VB front end.

                Mary
                But they refer to a report.
                I don't use VB as a front end myself so am unaware of which features are unavailable.
                I know I could use an Access report if I were controlling this remotely from an Excel front end (using the Access library).

                If that's not appropriate then please ignore my post Indra.

                Comment

                • AricC
                  Recognized Expert Top Contributor
                  • Oct 2006
                  • 1885

                  #9
                  In your for/while loop add something like intIndex += 1 that will increment the value each time you move through a record. By data report are you using Crystal Reports? Also, didn't see what version of VB you are using. Post what code you have if this doesn't help.

                  Comment

                  • indrag91
                    New Member
                    • Nov 2006
                    • 15

                    #10
                    Originally posted by AricC
                    In your for/while loop add something like intIndex += 1 that will increment the value each time you move through a record. By data report are you using Crystal Reports? Also, didn't see what version of VB you are using. Post what code you have if this doesn't help.
                    iam using vb6. data report connected using data environment.(no t crystal report).

                    Comment

                    Working...