Results 1 to 5 of 5
  1. #1
    lmarconi is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Sep 2020
    Location
    Muscat
    Posts
    74

    Autofill Combo box by any word

    Good morning everyone and Happy New Year!


    I have the following problem: in one of my form, i have a sub form with a combo box (named Comment Type) which has as source a list of "reasons" (see example below). The build in auto compile function, allow the user to select and full fill the entire option in the list. Some users asked to have the possibility to see the available entries based on the word they enter in the combo box. Example : if I write "Wrong" i would like to have all "reasons" which "includes" the word "Wrong" not only the first which start with "Wrong" and all rest (normal functionality). Follow is my form. Just for your information, the field Comment Type in the event "After Update" will write the new value if is not available in the list, just to be available next time. Any suggestion ? Thank you


    Click image for larger version. 

Name:	Option.jpg 
Views:	19 
Size:	71.7 KB 
ID:	43819
    Last edited by lmarconi; 01-03-2021 at 04:52 AM. Reason: Missing Attachment

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,424
    nothing attached

  3. #3
    lmarconi is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Sep 2020
    Location
    Muscat
    Posts
    74
    Quote Originally Posted by Ajax View Post
    nothing attached
    Sorry, now is attached. So, what i would like to know if it is possible that when i write "Missing" i got all options which include "missing" as word, if not, the system should show all options (like "*"). Thank you

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,424
    use some code in the combo change event to modify the recordset. However you appear to be using a table and tables do not have events, you will need to use a form

    the code might be something like

    Code:
    me.cboCommentType.rowsource="SELECT CommentType FROM myTable WHERE CommentType like '*" & cboCommentType.text & "*'"
    me.cboCommentType.Dropdown
    edit - second line of code added to display the dropdown

  5. #5
    lmarconi is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Sep 2020
    Location
    Muscat
    Posts
    74
    Quote Originally Posted by Ajax View Post
    use some code in the combo change event to modify the recordset. However you appear to be using a table and tables do not have events, you will need to use a form

    the code might be something like

    Code:
    me.cboCommentType.rowsource="SELECT CommentType FROM myTable WHERE CommentType like '*" & cboCommentType.text & "*'"
    me.cboCommentType.Dropdown
    edit - second line of code added to display the dropdown
    Thanks a lot, is exactly what i need, much appreciate.

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

Similar Threads

  1. Autofill text with a word based on combo selection
    By nick404 in forum Programming
    Replies: 2
    Last Post: 07-10-2015, 10:58 AM
  2. Replies: 1
    Last Post: 02-14-2015, 02:29 AM
  3. Autofill data using combo box
    By LukeJ Innov in forum Programming
    Replies: 1
    Last Post: 07-18-2013, 01:35 PM
  4. Combo Box autofill
    By sblack in forum Access
    Replies: 14
    Last Post: 10-02-2012, 09:17 AM
  5. Autofill combo value
    By survivo01 in forum Forms
    Replies: 7
    Last Post: 03-27-2012, 04:41 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