Results 1 to 9 of 9
  1. #1
    cheyanne is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Location
    Valencia, Spain
    Posts
    91

    Open subform record by clicking on subform vertical record selector


    I have a form (frmVisits) which logs pertinent details when a pet is seen by a Vet.
    The Vet would find it useful if he/she could see records for previous visits. I have introduced a
    subform (frmSubHistoria) which lists all that particular animals previous visits.


    It would be very useful if, when one clicks on the subform vertical record selector, the selected record
    was shown in full in frmVisits. Can this be done?


    Also how can I stop the subform showing, on the vertical selector column, "new" record

    I have attached a screen shot showing what I mean.

    Thanks
    Attached Thumbnails Attached Thumbnails Capture.jpg  

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,898
    You can stop the "*" record on the SubForm by setting the "AllowAdditions" to NO. When you click the Record Selector you will get a Current Event if the record changes. I personally do not like the Datasheet view and use a Continuous Form view and add a new button for such actions.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    cheyanne is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Location
    Valencia, Spain
    Posts
    91

    Solved two problems but created another in doing so

    Thanks for your prompt reply.

    I have actually just solved the two problems, but as is all too common in Access,
    I have created another one.

    When I select a record in the subform I effectively have a record set based upon that Pet's unique
    reference. That is the subform shows all of his/her visits. Exactly what I wanted to do

    However the problem I now have is how to get the focus off the subform and to allow me to return to ALL my records.

    Currently I am locked into this subset of records with no obvious way of returning to all my records.
    Maybe a button with code that would close the subform and open the main form again might be possible.

    Any ideas?

    Cheyanne

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,898
    To what do you have the Sub Form Control Master/Child Fields properties set?
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  5. #5
    cheyanne is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Location
    Valencia, Spain
    Posts
    91
    Thanks again

    The Linking field is PetRef which is the unique field in tblPets. See attachment.

    Please note that as I live in Spain so will not probably see any reply until tomorrow - probably the afternoon.

    I have found that by using the "Toggle Filter" button (found on the menu bar) I can get all the records back.
    This seems to toggle between the filter selected by entering the subform and the main form without any filter being applied.

    This confirms that once I click in the subform, a subset of records referenced to PetRef is made.


    What I need is a facility to leave the subform, once the searching has been completed and
    return to a "no filter" situation preferably by the use of code attached to an event on the subform.


    Regards

    Cheyanne
    Attached Thumbnails Attached Thumbnails PetRef.JPG  

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,898
    So your SubForm shows unfiltered record set until you click on the SubForm somewhere? I would think you would tie it to the Animal ComboBox. That would make the SubForm always follow the cbo animal.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,898
    The SubForm showing as Unfiltered would indicate that there is no matching MasterLinkField (PetRef) in the current record of the Recordset of the MainForm. Is that possible?
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  8. #8
    cheyanne is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Location
    Valencia, Spain
    Posts
    91

    Resolved

    Hi

    I have found a solution to my problem.

    I made a command button "Cancel Filter" and attached an action to it.

    The "ShowAllRecords" action works perfectly - see attachment.

    Many thanks for your assistance which was much appreciated.

    Regards to you and all those living around the Rockies.

    Peter
    Valencia Spain
    Attached Thumbnails Attached Thumbnails Cancel Filter.JPG  

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,898
    Excellent! Glad you got it sorted and shared your success and solution with us.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

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

Similar Threads

  1. Need to have subform open to the last record
    By PirateGenie in forum Access
    Replies: 1
    Last Post: 03-22-2013, 09:47 AM
  2. Replies: 6
    Last Post: 08-22-2012, 03:24 AM
  3. Replies: 2
    Last Post: 03-31-2012, 01:28 AM
  4. Replies: 5
    Last Post: 11-11-2011, 11:06 AM
  5. Open record from a subform
    By pratim09 in forum Forms
    Replies: 1
    Last Post: 04-28-2011, 12:01 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
  •  
Tech Forums: Microsoft Office Forums