Results 1 to 8 of 8
  1. #1
    pdowg881 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    14

    Opening Single Records from Datasheet View

    I have a form in datasheet view that has a user directory with a list of each person. On each row you can click to open another form that contains the users details using the below VBA:



    DoCmd.OpenForm "User Details", , , "[ID] = " & Me.ID

    But once you open to that specific record, no other records are available to navigate to.
    I want to be able to stay on that detail form that was opened and go to another record.

    How do I continue to pull up that specific user in my detail form, but also load the others so I can navigate to them from the detail form without having to go back out to the datasheet form?

    Thanks.

  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
    53,646
    Code could open the form with full, unfiltered dataset, then 'move' to the desired record - which is a bit trickier.

    One approach is to pass the ID to detail form in OpenArgs argument then code in the detail form would 'go to' the record.

    DoCmd.OpenForm "User Details", , , , , , Me.ID


    Code in detail form Open event using RecordsetClone and Bookmarks:

    If Not IsNull(Me.OpenArgs) Then
    Me.RecordsetClone.FindFirst "ID = " & Me.OpenArgs
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End If
    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
    JLCan is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2015
    Location
    Montréal
    Posts
    11
    Hi pdowg881!

    Your procedure is OK. You end up with 1 record (the one selected) and the add record line. Now check the navigation bar: your dataset is marked as FILTERED.
    Click this button then the whole set will be displayed...

    Good luck, JLCantara.

  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
    53,646
    Interesting, guess I've never tested that. I often disable the navigation bar on forms so this is not available to users.
    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.

  5. #5
    JLCan is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2015
    Location
    Montréal
    Posts
    11
    Hi June7!

    Disabling the navigation bar is no problem: I do it very often. Then move the Filter package to the QAT ribbon or your own ribbon!

    Good work, JLCantara.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    I do have custom ribbon, just never found need to have the Filter toggle there. I have command button and code that clears filters.

    Always more than one way ...
    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.

  7. #7
    pdowg881 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    14
    Maybe a simple way would be to have the filter dropped when the "Enter ID" or "Select User" controls get focus ? Would this work if I put that code in the first line of my after update code for those?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Try the AfterUpdate event, what happens?
    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: 05-12-2014, 12:24 PM
  2. Replies: 3
    Last Post: 02-10-2014, 03:57 PM
  3. Replies: 3
    Last Post: 08-18-2013, 09:14 PM
  4. Replies: 2
    Last Post: 05-15-2013, 09:03 PM
  5. Replies: 6
    Last Post: 11-21-2012, 05:10 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