Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    23

    Unanswered: Subform numbers??? Help Please!

    good afternoon,

    I have a form with several fields, and i have a subform in here that contains several other fields that allows to add new rows. I need to have a field that numbers the rows.
    something like this:

    number Other fields
    1 ........
    2 ........
    3
    4

    i have this function that do the work (well not very good, i must add)

    Public Function LineNumber(v As Variant) As Long
    Static j As Long
    j = j + 1
    LineNumber = j
    End Function

    the problem is that when i add new data the numbers go crazy
    and start adding

    if i close the form, and open it again, the number appears correct.

    Ah, autonumber is not a valid option!

    need help

    thank you

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by davidluz
    good afternoon,

    I have a form with several fields, and i have a subform in here that contains several other fields that allows to add new rows. I need to have a field that numbers the rows.
    something like this:

    number Other fields
    1 ........
    2 ........
    3
    4

    i have this function that do the work (well not very good, i must add)

    Public Function LineNumber(v As Variant) As Long
    Static j As Long
    j = j + 1
    LineNumber = j
    End Function

    the problem is that when i add new data the numbers go crazy
    and start adding

    if i close the form, and open it again, the number appears correct.

    Ah, autonumber is not a valid option!

    need help

    thank you
    Write a little routine that queries EXACTLY the same way that the subform orders itself ... And update the column that has your record number in it ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    May 2004
    Posts
    23
    Sorry, but how can i do that?

    i have tried to update, but i can´t seem to put this to work!

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •