Results 1 to 4 of 4
  1. #1
    sharkantipav is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    3

    Forbid an ID

    Hello All,


    I have a Database that I fill through VBA/Excel...
    My main field is TRADE_ID which is set on NoDuplicates.
    I have some trades that reset every month for 3 months for example
    So my field TRADE_ID will look like

    Code:
    ABCDEFGH-1   'for 1st month
    ABCDEFGH-2   'for 2nd month
    ABCDEFGH-3   'for 3rd month
    When my trade is closed... I want to forbid ABCDEFGH as the beginning as an ID

    I dont know how it can be possible

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Why is Excel involved?

    What would you use in place of ABCDEFGH?

    What criteria would be referenced to 'know' that ABCDEFGH should not be used?
    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
    sharkantipav is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    3
    From excel I import several fields
    In column B I have TRADE_ID
    In Column A I have NEW/RESET/CLOSE

    So basically when there is CLOSE Just before he will import the record with the last ID.... ABCDEFGH-3 for this example and will forbid ABCDEFGH
    Next trades will look like GHTFRES-1 etccc

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Generating unique identifier is a common topic in forum. However, the usual requirement is to assign ID at time record is created.

    Doing this during import from Excel will be difficult if not impossible. Maybe have to run code after import to 'fix' the ID.

    What method are you using for import?

    Still doesn't explain why Excel is involved. How does this data get into Excel? Why not directly into Access?
    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.

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