Results 1 to 2 of 2
  1. #1
    Syla is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2020
    Posts
    19

    Search Combo Box

    Hi All,



    I have an access form which currently has a search text box - if you enter '2011' all orders id's from week 2011 will show in a combo box and a sub form below however it will only let you search once. You have to close and reopen the form for it to search again.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    the query in the subform should be filtered when user enters a value in the combo:
    Code:
    
    sub cboBox_afterupdate()
    if isNull(cboBox) then
       me.subform.form.filteron = false
    else
    
    me.subform.form.filter = "[field]='" & forms!fMasterFrm!cboBox & "'"
    me.subform.form.filteron = true
    endif end sub


    or the query for the subform could just be swapped.
    the combo would have 2 columns ; 1 with the caption, 2 with the query:

    me.subform.sourceobject = "query." & cboBox.column(1)


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

Similar Threads

  1. Replies: 5
    Last Post: 09-22-2016, 08:42 AM
  2. Replies: 3
    Last Post: 01-04-2015, 06:09 PM
  3. Replies: 7
    Last Post: 08-08-2012, 03:28 PM
  4. Replies: 1
    Last Post: 04-20-2012, 03:16 AM
  5. Replies: 4
    Last Post: 08-16-2011, 05:54 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