none
Need Help Adding Sequential Numbers to Rows in Access Web App Datasheet RRS feed

  • Question

  • Hello,

    In my Access Web App I have a Blank View with a ComboBox that passes a parameter to a query and then opens a pop up Datasheet. In that datasheet, I'd like to be able to total the rows somehow, either by adding sequential numbers to each row using a macro, or by some other means.

    I found this solution (https://social.msdn.microsoft.com/Forums/office/en-US/fde68cf4-0e76-42c0-9fab-a8b3962c7622/list-row-numbers-and-show-total-number-of-rows-in-access-custom-web-app?forum=accessdev), but it doesn't work with my parameter query. It keeps saying the parameter is not being passed through.

    Any ideas?

    Friday, March 17, 2017 8:12 PM

Answers

  • Hello,

    I suggest you create a field like ListNum in the table and then update the field according to query row number.

    E.g.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, March 20, 2017 7:50 AM
    Moderator

All replies

  • Hello,

    I suggest you create a field like ListNum in the table and then update the field according to query row number.

    E.g.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, March 20, 2017 7:50 AM
    Moderator
  • Hi Celste,

    This works, but the problem I am having is that when I choose between two different parameters, the number sequence does not reset.

    For example, I choose the parameter "2016" and it enters the numbers 1-200 in the ListNum field, for 200 records found.

    Then when I choose the parameter "2017" it enters 201-205 in the ListNum field, for 5 records found.

    Any suggestions?

    Thanks

    Friday, March 24, 2017 7:51 PM
  • so the fundamental issue is that sequential numbering doesn't occur at the table level in databases; consider the scenarios where a record is deleted - all the sequential number would have to be reset.

    instead sequential numbering occurs at the presentation level - but I don't work in Access web forms so not sure how it is implemented in that type object so sorry for an incomplete answer.....

    Friday, March 24, 2017 10:43 PM
  • Do you want the Start number based on the count of previous query ? We couldn't get the previous query count since there are parameters for the query. A workaround might be: Set a return value when running the query and create a new table to store the count for each query and pass the value as a startnumber for the data macro.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, March 27, 2017 9:35 AM
    Moderator
  • Hi Celeste,

    No, I want the count to start over for each query based on the parameters.

    Right now the count is continuing from the previous query.

    Do you have any suggestions?

    Monday, March 27, 2017 7:17 PM
  • Hello,

    I think the datamacro in my first post is starting from 1 for each query.

    Since your original issue has been resolved, I suggest you post a new thread for the new issue when using two parameters. And i suggest you share us your current data macro.Thanks for your understanding.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 28, 2017 7:24 AM
    Moderator