Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Seemingly simple question, and have found a variety of answers that circle my version.

    I have a Main Form display Classes using qry_classes.

    I have a subform using qry_classes.

    The subform is in Datasheet view mode and displays all of the records in qry_classes

    These two forms are NOT linked in any way.

    Is it possible to "click" on a specific record in the Datasheet and have the Main Form "go to" that record.

    I already do this via a combo select box, but doing it via the Datasheet would be neater.

    Thank you in advance for any help with this
    Cheers,
    Andy

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    If you are using Access 2007, you could use the new Split Form. It does exactly what you want.

    Instead , I personally reverse the relationships between the forms. The Main Form is the continuous form, and shows all the records. I then place a second form in the form header of the continuous form as a subform. If you link the two forms using master and child fields, the subform will display the selected record from the main form. (Access says you can't do this, but it works. You need to set the main form back to Continuous after Access changes it to single.)
    [attachment=89609:formsandsub.gif]
    Attached Images Attached Images
    Regards
    John



  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi John,

    Thanks for taking the time to respond. I'm using Access 2003, so unfortunately I don't have access to the Split Form feature.

    Using your other approach might be a tad messy for me based on the complexity/busyness of my current form. If I knew how to embed a
    "snapshot" of it in this reply, you could see what I'm getting at.
    Cheers,
    Andy

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    It is also possible to do what you describe using two subforms in a main form - but you have to write a bunch of VBA to filter the top subform (in single record view) based on the record currently selected in the bottom subform (in continuous record view). I frankly prefer a treeview to do this sort of thing however. It makes better use of screen real estate, and lets you scroll up and down through records.
    Wendell

  5. #5
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Wendel,

    Thanks for jumping into the thread. You make writing a bunch of VBA sound like it's not the ultimate good time. It would be interesting to see an example of that which you describe.

    And, never having even looked into treeview, this will give me something else to do in my spare time. If you can point me in the direction of a good example of that, I'd much appreciate it.
    Cheers,
    Andy

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Attached is an example where I have put the continuous form in the footer of the single form. In this case the single form is based on a query that uses the current record in the continuous form as a parameter.
    This requires a line of code in the Current event of the subform to requery the main form.

    [attachment=89619:FormandSubform.zip]
    Attached Files Attached Files
    Regards
    John



  7. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Unfortunately TreeViews aren't supported in native Access - they require an Active-X OCX control typically, and require you to write a bunch more VBA than the approach John suggested. If you want to read a bit about it check out DBI Technologies Treeview as well as the one that came with the Office Developer version up though 2003 - the latter is free, the former is not but much less resource intensive. You can see some examples of how they are used in our portfolio - they look much like the left side of Windows Explorer, but let you display a specific record in a form by clicking on a node of the tree. But not for the faint of heart when it comes to programming.
    Wendell

  8. #8
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wendell,

    It's not so much that I'm faint of heart with respect to trying something new, it's more with the abilities of the user to understand something beyond the standard-type screen which even they can manage to have a problem with. It'll still be something worthwhile to look into just for curiousities' sake.
    Cheers,
    Andy

  9. #9
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by John Hutchison View Post
    Attached is an example where I have put the continuous form in the footer of the single form. In this case the single form is based on a query that uses the current record in the continuous form as a parameter.
    This requires a line of code in the Current event of the subform to requery the main form.

    [attachment=89619:FormandSubform.zip]
    Thanks muchly for your download sample. This'll give me something to deal with in my 'spare' time.
    Cheers,
    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •