Results 1 to 9 of 9
  1. #1
    clyle is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2016
    Posts
    4

    Lightbulb Double click on record in list box to open record above

    I have it bound on ID (numbers to the left in the list box) and I want the users to be able to scroll through the list box and double click the record they want to open. As it sits right now all I can do to navigate it is click the arrows above. The listbox is bound to query 2. I don't know if that makes a difference. I have no idea what I'm doing.






    Click image for larger version. 

Name:	help.png 
Views:	18 
Size:	114.6 KB 
ID:	23571

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    It looks like you have a main form with a subform datasheet, but I don't see any list boxes - just what look like text boxes and there's a huge difference. If they're text boxes, the data in the sub form is supposed to be linked to whatever field you chose in the setup as the parent id of the record. The subform then displays the records related to the id on the main form if that's the parent field you chose to make the relationships between the two forms. The form navigation buttons down at the bottom left are used to move between main form records. If you're not seeing what you expect from this image, note that you have a filter applied (bottom of screen). So I don't see a need to navigate to a record below by double clicking on a text box. You should already be there based on the parent/child relationship between the main and subform recordsets. If you need to check this relationship, put the main form in design view, click on the subform control (it will highlight a box around the subform, but it is not the subform) and look at the data tab on the property sheet.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    clyle is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2016
    Posts
    4
    I clicked on list box in the design tab, so I could only assume it was a list box. It's set to display a query and I can scroll through every item in the query which is pulled from the table. Yes, the highlighted object is what is displayed in the area above but I want to be able to click or double click anywhere in the text box (or list box, whichever it is) and display the highlighted information without having to click my way to the item. I can simply search for it, but I'd like it to be a little more intuitive.
    Click image for larger version. 

Name:	help2.png 
Views:	16 
Size:	20.2 KB 
ID:	23572

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Based on why I see, I think you have this design all wrong. As I mentioned, the way you have set up the form/subform doesn't usually involve listboxes. I don't even see a scroll bar on your listboxes that allows you to navigate through whatever is in the list. The form/subform relationship is one-to-many by design. I can't recall ever seeing where part of the 'one' ever has multiple values for one of the fields. I don't consider a combo box or list box that drives what record is seen on a form to be the same thing. The records in those lists contain fields that can be found on the form records, but they are not part of the form record itself. They have their own sources and they drive what's displayed in the main form and/or its results. What you're doing is different. Unless I have all of this wrong, I don't see how I can help you achieve what you asked for in your original post. I mean, I suppose it's possible, but I think you have a bigger problem, based on the form design.

  5. #5
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    I would do Something like

    sub listbox_click()
    Me.Parent.Form.Filter [fieldtofilter]=Listbox.Items.Subitems(columnnumber)
    end sub

    or something of that nature. I seen listboxes used like this a lot. Especially in Older Access Applications, or ones made by vb4 programmers.

  6. #6
    clyle is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2016
    Posts
    4
    Quote Originally Posted by Micron View Post
    Based on why I see, I think you have this design all wrong. As I mentioned, the way you have set up the form/subform doesn't usually involve listboxes. I don't even see a scroll bar on your listboxes that allows you to navigate through whatever is in the list. The form/subform relationship is one-to-many by design. I can't recall ever seeing where part of the 'one' ever has multiple values for one of the fields. I don't consider a combo box or list box that drives what record is seen on a form to be the same thing. The records in those lists contain fields that can be found on the form records, but they are not part of the form record itself. They have their own sources and they drive what's displayed in the main form and/or its results. What you're doing is different. Unless I have all of this wrong, I don't see how I can help you achieve what you asked for in your original post. I mean, I suppose it's possible, but I think you have a bigger problem, based on the form design.

    Probably. This is my first attempt at an Access Database, and I don't have any idea what I'm doing.

  7. #7
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I guess others have seen this, but I never have. Not in my 20 odd years of playing with Access anyway. If it's typical to do this today, I hope someone will post about it because I'd like to learn more about why it would be done. I can't find anything on the idea - only about using listboxes to drive the records displayed on a form when the list box is not part of the records returned.
    Last edited by Micron; 02-04-2016 at 01:07 PM. Reason: chgd 30 to 20

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It looks to me like it is the same as having an unbound combo box in the form header to search for records. In the click event of the list box, set a form filter or use a recordset clone to set a bookmark or use the findfirst method.

  9. #9
    clyle is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2016
    Posts
    4
    Quote Originally Posted by ssanfu View Post
    It looks to me like it is the same as having an unbound combo box in the form header to search for records. In the click event of the list box, set a form filter or use a recordset clone to set a bookmark or use the findfirst method.
    Awesome. I will give this a try.

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

Similar Threads

  1. Replies: 6
    Last Post: 09-30-2015, 05:59 PM
  2. Replies: 1
    Last Post: 07-14-2015, 05:59 AM
  3. Double Click current record to Edit
    By projectpupil7 in forum Access
    Replies: 18
    Last Post: 11-25-2014, 01:03 PM
  4. Replies: 2
    Last Post: 10-29-2014, 03:25 AM
  5. Replies: 10
    Last Post: 02-20-2012, 11:25 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