Results 1 to 4 of 4
  1. #1
    kaim is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Location
    Georgia
    Posts
    8

    ACCESS newb needs help with Refrencing a prevous record.

    Hello all,



    I am new to the forum and new to access with a question. I am working with access 2010 and am having an issue citing a previous record. heres the rundown.

    These records will be used to keep up with maintnance on our shop floor.

    If i have an open issue and i want to continue between multiple shifs i would like to be able to have each shift manager creat a new record and for report purposes i would like to be able to track between the different shifts.

    I have a unique number for each entry and i would like to be able to put something in the form if its a continuation of the prevous shift to mark that unique number...

    Any help would be appricated,

    Kai M.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    previous record is relative, depending on your sort. if sorted by AUTONUM then yes, you can. [id] and [id]-1, but if your sort is anything else, no.

    since any given record cannot see what is next to it, then you can only do it with code.
    Code:
    dim vName, vName2
    dim rst
    
    set rst = currentdb.openrecordset("qsMyQuery")
    with rst
      while not .eof
          vName = .fields("Name").value
       
         .movenext    'get next record in list
    
    
             'NOW YOU CAN SEE THE NEXT RECORD
          vName2 = .fields("Name").value 
       wend
    end with
    set rst = nothing

  3. #3
    kaim is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Location
    Georgia
    Posts
    8
    Quote Originally Posted by ranman256 View Post
    previous record is relative, depending on your sort. if sorted by AUTONUM then yes, you can. [id] and [id]-1, but if your sort is anything else, no.

    since any given record cannot see what is next to it, then you can only do it with code.
    Code:
    dim vName, vName2
    dim rst
    
    set rst = currentdb.openrecordset("qsMyQuery")
    with rst
      while not .eof
          vName = .fields("Name").value
       
         .movenext    'get next record in list
    
    
             'NOW YOU CAN SEE THE NEXT RECORD
          vName2 = .fields("Name").value 
       wend
    end with
    set rst = nothing

    The only issue i have with this is it may not be the last record its going to be some record in prevous... It will have approx 12 people adding to this form at at any given time. so it may be the very last in the database or it may be 3-5 entrys up... Any way to do this?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    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: 1
    Last Post: 08-20-2015, 04:46 AM
  2. Replies: 9
    Last Post: 08-19-2015, 02:09 PM
  3. Access newb
    By dsscripts in forum Access
    Replies: 5
    Last Post: 02-10-2014, 01:30 PM
  4. Networking and Access (pardon my newb-ness)
    By kpo in forum Database Design
    Replies: 3
    Last Post: 03-05-2013, 11:12 AM
  5. Replies: 0
    Last Post: 02-28-2010, 08:35 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