Results 1 to 7 of 7
  1. #1
    christing is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2019
    Posts
    10

    CUSTOM ID after user restart program it fail auto count

    When user restart program ID can not continue count.


    for example INV001 ,INV002,when user restart the program the ID will recalculate from to INV001.

    Dim ids As List(Of Integer) = New List(Of Integer)()
    For i As Integer = 1 To 100
    ids.Add(i)
    Next


    Dim idstring As String = "INV" & ids(count).ToString().PadLeft(4, "0"c)
    Textbox1.Text = idstring
    count += 1
    Last edited by christing; 08-05-2019 at 09:29 PM. Reason: type not perfect titile

  2. #2
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    When the Program reloads or the Form? Wouldn't it add one when they press the Add New button?

    Hmm, maybe it would help if you would tell us how this Form works or better yet what are the steps that are applied to cause a new Invoice ID to load.

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    That's not VBA, looks like VB.Net. In any case, you need to store the inv numbers in a table. Then to continue, the code needs to find the highest existing inv number and continue from there.

  4. #4
    christing is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2019
    Posts
    10
    Yes this is not a vba it is a vb.net...if user continue add a new data the inv id will calculate continue. if user restart the program the auto id (INV001) will return back to inv001

  5. #5
    christing is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2019
    Posts
    10
    the process is when the program start and user key in data successful it will auto give a new id and continues until user restart the program the id will recalculate from INV0001

  6. #6
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    My bad, saw it was in the Access > Forms section... moving along.

  7. #7
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    I haven't used VB.Net much since 2010, so I can't be any more help than the generalization in post#3. Access is not a tool for web development, as VB.Net is. You'd have better luck at a web development forum.

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

Similar Threads

  1. Need a Custom PK
    By Tac22 in forum Access
    Replies: 6
    Last Post: 07-01-2019, 12:58 PM
  2. About Custom ID
    By notrino in forum Access
    Replies: 1
    Last Post: 12-16-2018, 03:28 PM
  3. Replies: 2
    Last Post: 05-27-2014, 11:32 AM
  4. Custom Ribbon
    By nkuebelbeck in forum Programming
    Replies: 5
    Last Post: 08-25-2011, 11:55 AM
  5. custom mask
    By RedGoneWILD in forum Reports
    Replies: 2
    Last Post: 08-04-2010, 03:23 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