Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2004
    Posts
    4

    Unanswered: How to use record numbers to populate a field inside a subform.

    I have a subform that I would like to set a default value for. I would like it to be the new record number listed on the bottom as in n of m. What is the expression that i need to use to do this. I've tried several things to no avail including 1+count([field]). For some reason that only works some of the time however the record number always increments correctly and i would like to use it to populate the field value if possible. Thanks in advance,

    Stormy

  2. #2
    Join Date
    Jul 2004
    Posts
    125
    The number appearing on the form's status bar is not a unique identifier, but the number of records in the currently displayed recordset. This is not the same as a record number. When the recordset changes with deletions and additions, and you use that for a pointer, it would point to the wrong record.

    For simplicity, just add an AutoNumber field or any field which would uniquely identify the record.

  3. #3
    Join Date
    Aug 2004
    Posts
    4

    Sorry an autonumber wont work needs to be like a running sum

    Autonumber will not work in this case as it is not unique. In point of fact they are cd track numbers. They recure often and the tracks themselves are uniquely identified with an ID. I tried simply counting and adding one while it does work sometimes it doesnt appear to every time.

  4. #4
    Join Date
    Jul 2004
    Posts
    56

    Solution

    On you sub form create a list box using the wizard that will find a record on your form. Use a query to list all tracks for the particular album. (Build a parameter query using the unique number of the album so that it will only select the tracks from the album number that is shown on the main form}. Then once you have clicked in the list box on the track you want to see in your sub form it will select that record. This will stop you having to think about the record selctor numbers being relevant to your track number.

    Hope this makes sense and I have understood you properly if not let me know.

  5. #5
    Join Date
    Aug 2004
    Posts
    4

    Good solution but the subform was made to list all tracks currently.

    Good solution however the subform lists all the tracks inside of it in continuos forms linked to the master table of titles by unique title id. It also allows you to add new records which are also uniquely identified by track id. Rather than make the user type the next track number I'm simply trying to populate it as they go on.

  6. #6
    Join Date
    Aug 2004
    Posts
    4

    Needs to be more like a "running count" of records

    Sorry to continue on in another post like this but it occurs to me it needs to be more like a running count. The record selectors in the current form display the value I need and I thought if there were somehow I could utilize this value for a default then it would be the easy way. As usual I have found no easy way for this....

Posting Permissions

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