Results 1 to 11 of 11
  1. #1
    newegyptian is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2019
    Posts
    46

    new autonumber in each record

    i have two linked table












    i made autonumber for subform




    but it give autonumber continuos in all record

    ex : record num 16 have autonumber 2,3,4



    in record num 17
    the autonumber was 6,7,8



    i need new autonumber in each record 1,2,3 ... etc in each record

    not 1,2,3 in first record
    then 4,5,6 in next record

    want to make record num 16 have autonumber of 1,2,3
    and record num 17 have autonumber of 1,2,3 not 4, 5,6

    how i can do that
    ?????

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,891
    That is not autonumber. Would have to use VBA code to calculate and save the next number in sequence.

    Why bother with this? What purpose will it serve?

    This sequence can be dynamically calculated on report use Sorting & Grouping features and textbox RunningSum property.
    Last edited by June7; 03-21-2019 at 02:25 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    autonumber just grows, it does not start at 1 for every new record (and doesn't need to)
    Humans dont need to care about it, only the record does.

  4. #4
    newegyptian is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2019
    Posts
    46
    I want to set visit nimber of each patient

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,891
    Generating custom identifier is a common topic. As stated, requires code. Also stated, can just calculate this sequence in report.

    Surely you save the date of each visit? Use that to order records in report, set a grouping on patient ID and use the RunningSum property of textbox to calculate the sequence number for each group. Then you won't need any code.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    newegyptian is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2019
    Posts
    46
    Quote Originally Posted by June7 View Post
    Generating custom identifier is a common topic. As stated, requires code. Also stated, can just calculate this sequence in report.

    Surely you save the date of each visit? Use that to order records in report, set a grouping on patient ID and use the RunningSum property of textbox to calculate the sequence number for each group. Then you won't need any code.
    Good idea
    How i can order record in report?
    How i can set groubing on patient id ?
    How i can use property of running sum?

    Thanks

  7. #7
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    Quote Originally Posted by newegyptian View Post
    Good idea
    How i can order record in report?
    How i can set groubing on patient id ?
    How i can use property of running sum?

    Thanks
    These are all standard report properties / features. Have look here https://support.office.com/en-us/art...2-4a23ac0fdbf3
    or play with the report wizard to get you started.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #8
    newegyptian is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2019
    Posts
    46
    i dont want report

    i want it to be in form
    when i type new record
    i need the visit number to be appeared

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,891
    As already stated, requires code.

    This is a fairly simple calc. Real trick is figuring out what event to put code in.

    DMax("PhoneID", "phone", "ID=" & [ID]) + 1
    Last edited by June7; 03-29-2019 at 11:16 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    @newegyptian

    For more info on Autonumbers, please see this.
    It seems you are confused/inexperienced with some database and Access concepts and facilities.
    I suggest you watch free youtube videos by Richard Rost (599CD)--here is a series that should help.
    For additional info on Database Planning and Design and related articles, try this link.
    Good luck with your project.

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    @newegyptian

    For more info on Autonumbers, please see this.
    It seems you are confused/inexperienced with some database and Access concepts and facilities.
    I suggest you watch free youtube videos by Richard Rost (599CD)--here is a series that should help.
    For additional info on Database Planning and Design and related articles, try this link.
    Good luck with your project.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 01-10-2019, 08:55 PM
  2. Get autonumber after new record entered
    By GraeagleBill in forum Forms
    Replies: 4
    Last Post: 08-24-2016, 10:23 AM
  3. Replies: 19
    Last Post: 12-21-2012, 06:57 AM
  4. Replies: 1
    Last Post: 02-02-2012, 08:34 PM
  5. Replies: 4
    Last Post: 04-07-2011, 04:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums