Results 1 to 11 of 11
  1. #1
    Daimios is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12

    Question Command button "Detail for specific entry"

    Hi everyone,



    I'm new at Access and currently try to basically create a form that will display all my entries, but with a button next to each entry that will open a "detail" form for this specific one.

    I have placed a button with the action "OpenForm" but it keeps opening the details for all entries on the same screen, I don't find the switch to make sure it displays only the details to the entry to which it is related.

    Could anyone help ? That'd be highly appreciated

    Thanks !

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Daimios is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    Yes that type of thing, but it does not seem to work for me, but I might do something wrong.

    I added a button and pasted the following code in it : DoCmd.OpenReport "E_Detail", , , "Pseudo = ' " & Me.Pseudo & " ' "

    E_Detail being the detailed report for the entry selected
    Pseudo being the entry on which I want the filter applied in the detailed report AND the name of the entry in the general report.

    The result is quite surprising : it opens Microsoft OneNote and pastes the E_Detail filtered, but on the first entry only. That is, imagine that I have 3 entries in the general report : Bob, Rick & Will. Clicking on any of the three command button will open OneNote with E_Detail for Bob (even if I expected Rick or Will).


  4. #4
    Daimios is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    Actually, what I also tried is creating a macro OpenReport with condition [Table General]!Pseudo = [Pseudo]. When I do this, the filter works fine but .. a window pops up when I click the command button to ask me for the value of [Pseudo]

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    For starters, try without the spaces:

    DoCmd.OpenReport "E_Detail", , , "Pseudo = '" & Me.Pseudo & "'"

    in the macro, I'm pretty sure you need the full form reference. If you're still stuck after trying the above, can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Daimios is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    I did try with more precise references (not only "Pseudo") and without spaces but that did not solve the problem.

    DB can be downloaded here : https://docs.google.com/file/d/0B-0K...it?usp=sharing

    Thank you !

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Seems to want a password. If you do a compact/repair then zip it, you should be able to attach it here.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Daimios is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    It should work now
    Attached Files Attached Files

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This seems to work:

    DoCmd.OpenReport "E_Detail", acViewPreview, , "Pseudo = '" & Me.Pseudo & "'"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    Daimios is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    12
    Actually I just figured that it works even better with acViewReport, to keep it in the same format (not the print preview one)

    Thanks a lot for the quick help !

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Column sum works in "Detail" but not "Footer"
    By Doodlebug2000 in forum Reports
    Replies: 1
    Last Post: 12-10-2012, 03:20 PM
  2. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  3. Replies: 0
    Last Post: 01-11-2012, 12:34 PM
  4. Replies: 1
    Last Post: 03-30-2011, 06:16 PM
  5. "Next" Command button.
    By vCallNSPF in forum Forms
    Replies: 8
    Last Post: 01-20-2010, 04:26 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