Results 1 to 4 of 4

Thread: Generate Auto-number in Network Environment

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    1

    Question Generate Auto-number in Network Environment

    hi all

    plz help me .... so confusing.....

    i wanna generate a receipt number .... i got four computers that running at one time which refer to a server comp where the dbase is located... what im doing now is i read the highest number frm the dbase then i plus with 1.... but the prob is all those four computers wil have the same number n now i got redundant receipt number which is realy incorrect....

    so i wanna ask frm u guys how to solve this matter so that if the current highest receipt no in the dbase in 100 so the 1st comp wil have 101, 2nd comp wil have 102, 3rd comp wil have 103 n 4th comp wil have 104 ... NOT 101...!

    System: VB 6.0
    Dbase: MS Access 2000

    plz guys .... realy apreciate it..... thans a lot.....

  2. #2
    Addicted Member
    Join Date
    May 2004
    Location
    Nagpur, India
    Posts
    228

    Re: Generate Auto-number in Network Environment

    Looks difficult. Why the receipt number is needed at the computer 1..4 etc
    You can do the calculation at the time of inserting records anyways.
    Event using Identity column can solve this problem

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Generate Auto-number in Network Environment

    Quote Originally Posted by mayurvb
    Looks difficult. Why the receipt number is needed at the computer 1..4 etc
    You can do the calculation at the time of inserting records anyways.
    Event using Identity column can solve this problem
    I don't know if Acess supports IDENTITY, but, you can create an AutoNumber field which will auto increment on each INSERT and provide a unique number which can be used for your receipts.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Generate Auto-number in Network Environment

    Yes, Access does support Identity but its limited.

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width