Results 1 to 5 of 5
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Search from a list box

    This might be hard to explain. I have a form [frmEventsEnter]. I search with month and year fields. The results appear in the list box [lstEventsListing]. I want to be able to click on the list box and the information appear in the form.


    The row source for the list box is: SELECT [EventID], [EventDate], [Event] FROM qryEventListing ORDER BY [EventDate];
    I tried to put on click: Me.EventID = lstEventListing
    That took me to the debugger.

    Click image for larger version. 

Name:	Event.jpg 
Views:	17 
Size:	62.4 KB 
ID:	35036

  2. #2
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    I think you just need Me.EventID = me.lstEventListing.selected (assuming it's not a multi-select list box). I do this loads on my forms. Think that's all you need but will check and get back to you.

  3. #3
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    No. Went to the debugger again.

  4. #4
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    Is it a bound or unbound form? I assume the latter, in which case it should be the recordsource of the form that you're adjusting I think. [Forms]![Events].RecordSource = "SELECT * FROM Bla WHERE [EventID]= " & Me.lstEventListing.selected. Hopefully that should work if I've understood correctly

  5. #5
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    It's a bound form. I need it to open up to the record I select from the list box.

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

Similar Threads

  1. Search in a list box
    By cpullen91 in forum Forms
    Replies: 1
    Last Post: 05-23-2016, 12:13 PM
  2. A-Z Search List Help
    By pattrickcolin in forum Access
    Replies: 3
    Last Post: 08-29-2015, 03:14 PM
  3. Replies: 3
    Last Post: 09-02-2013, 04:33 PM
  4. Search List Box with Text Box
    By dalton in forum Access
    Replies: 6
    Last Post: 01-30-2013, 09:58 AM
  5. Search From List and Key Search
    By netchie in forum Forms
    Replies: 14
    Last Post: 02-23-2012, 01:37 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