Results 1 to 4 of 4
  1. #1
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Cool get max srno base on date

    dear all,
    i have a form in which i enter leaves with from and to date.

    now i want to generate auto serial no base on from date.

    for example i am updating 01-nov leave and total 10 id number's leaves in 01-nov i have updated it means max srno is 10 in date 01-Nov.



    now i have update 02-nov leaves for 5 id numbers
    in date 02 max srno should be 5.

    now if i update for 01-nov it should start from max srno 11.



    how can i do during live updating leaves on form

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    This will require VBA code and can be complicated, especially as you have multiple series. Why do you need to do this?
    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
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117
    thanks

    i need this due to we update different types of leaves and then archive these papers this srno will help to make document number which we will put on document and base on this srno it will go into file.

    to find this paper base on document no it will be easy in future.

    can you explain vba code?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I can offer you example code I use to generate a unique identifier. In my case there is only one series that starts over each year. Review this thread http://forums.aspfree.com/microsoft-...ta-403208.html

    I recommend easier alternative is to use the Autonumber field to generate a unique ID for each record. You can then format this field to look like anything you want. Take unique ID of 1 and you want to show it as ABC00001. This would be accomplished with an expression in the ControlSource property of textbox on form: "ABC" & Format([ID], "00000")
    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.

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

Similar Threads

  1. Cannot add records to the data base
    By vagelism22678 in forum Access
    Replies: 1
    Last Post: 09-19-2011, 12:45 AM
  2. converting base 32 to base 10?
    By brandonze in forum Access
    Replies: 13
    Last Post: 08-01-2011, 04:11 PM
  3. Base-34 class or alternetives
    By is49460 in forum Programming
    Replies: 3
    Last Post: 06-29-2010, 07:59 PM
  4. Data base design
    By mduplantis in forum Database Design
    Replies: 1
    Last Post: 06-05-2010, 07:30 PM
  5. Same Form, different base query
    By Goodge12 in forum Forms
    Replies: 3
    Last Post: 01-22-2010, 11:29 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