Results 1 to 2 of 2
  1. #1
    corptkm is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    5

    Subtract Number then Place in field in sequence




    I'm starting with a number 5500


    I have a field named "Prev_ADSK" If that value is True

    I would like to have that number placed it in field "EMP_ID" in another table.

    Example: if a project has 10 employees. And 5 of them have a true value in "Prev_ADSK" (text field).

    The number 5500 would be placed in the first employee record in field "EMP_ID". The second employee with true in "Prev_ADSK" would get the next number 5499 and the next employee would get 5498 and so on. Once all of the True "Prev_ADSK" fields have been placed. I would like to subtract 3 additional numbers from the final number.

    Example: If the last number is 5490. I would like to subtract 3 numbers from that number in case we hire 1-3 more employees and need those numbers for the new employees at a later date.


    How would I start this procedure? Do I have another table that list the numbers?

  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,929
    Essentially duplicate thread https://www.accessforums.net/access/...ble-42729.html

    Whether updating existing records or populating a new record, this is fairly complicated coding. For updating existing records, could involve opening a recordset filtered to Prev_ADSK = True, looping through the records, determining next value, populating field and repeat. Not a task I wish to tackle for you from scratch.

    If you have little to no VBA programming knowledge, this will be a significant challenge and you have a lot to learn. Do research on opening and manipulating recordsets. When you have attempted code and encounter issues, post for analysis.

    Generating unique identifiers is a common topic in forum.
    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. Replies: 4
    Last Post: 03-31-2014, 02:20 PM
  2. Replies: 6
    Last Post: 12-05-2013, 09:55 AM
  3. Show next number in sequence
    By cbrsix in forum Programming
    Replies: 1
    Last Post: 08-15-2013, 04:09 PM
  4. Enter new number in sequence in PO
    By tchirpich in forum Access
    Replies: 30
    Last Post: 12-30-2011, 11:24 AM
  5. Replies: 2
    Last Post: 11-21-2011, 10:48 AM

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