Results 1 to 8 of 8
  1. #1
    raychow22 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    145

    Auto List Combo Field Editing

    Hi Forum,



    Is there a way for a combo box on the Form to help requery the "List" again after a comma "," or a semi-colon ";".

    For example I have a combo box for of names list as followed:
    1) Alpha
    2) Beta
    3) Omega

    Since this is a single field, I can really only select one; however this is not limited to the list so I can add if I wanted to.

    Let's say I enter the combo box "A" and it helps me find "Alpha", then I want to be able to find "Beta" after I separate it with a "," or ";". I would just enter "B", and Access will help me find "Beta" on the list for me.

    Is this possible?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I'm sure it's possible, but add more detail to your requirements description. Get some sample data. For each test record, write down what should be done to get the format/result you want. Make sure you understand the logic of your proposed process(es) before jumping in to a physical database and doing a trial and error approach to getting it right.

    You might also want to review the Split function in Access.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    difficult and awkward,
    instead, use a list box, then the user can just dbl-click the item needed.
    place all clicks into a text box via:

    Code:
    sub lstBox_dblClick()
    txtBox = txtBox & ";" & lstbox 
    if left(txtbox) = ";" then txBox = mid(txtBox,2)
    end sub

  4. #4
    raychow22 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    145
    Quote Originally Posted by ranman256 View Post
    difficult and awkward,
    instead, use a list box, then the user can just dbl-click the item needed.
    place all clicks into a text box via:

    Code:
    sub lstBox_dblClick()
    txtBox = txtBox & ";" & lstbox 
    if left(txtbox) = ";" then txBox = mid(txtBox,2)
    end sub
    I've tried this method. I got an error which Highlighted "Left"

  5. #5
    raychow22 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    145
    Quote Originally Posted by orange View Post
    I'm sure it's possible, but add more detail to your requirements description. Get some sample data. For each test record, write down what should be done to get the format/result you want. Make sure you understand the logic of your proposed process(es) before jumping in to a physical database and doing a trial and error approach to getting it right.

    You might also want to review the Split function in Access.
    The idea here is to get away from multi-value fields. combo box can have multiple selections from my list. I want to be able to use a delimiter (comma/semi-colon) to restart the combo list and help me requery the list again so I can find second, third and so on ..

  6. #6
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Show us some sample data. And tell us what you want to achieve in plain English - no database jargon.

    to get away from multi-value fields
    why do you have them in the first place?
    Tell us about the database/application.

    It seems you are dealing with a form but you have told readers nothing about your needs in business terms and nothing about your tables.
    Good luck.

  7. #7
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I got an error which Highlighted "Left"
    if left(txtbox)
    Check out the Left function. Your syntax is incomplete.
    I don't think what you're trying to do is possible. Multi value fields look like the values are in one field, but in fact they are not. They are stored in hidden system tables in a manner that resembles normal table relationships anyway, with the downside that you can't see them. Thus I don't see any string function (such as Left) ever working. About the only way I've ever been able to separate them is to use the .Value property of a MVF in a query, and that was only for testing.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You want to get away from multi-value field yet store multiple data elements as a CSV string in a single field? Can't say that is an improvement. So what purpose does combobox serve - validate the user free-type input by matching to list items? It may be possible with complicated and creative code, possibly in Change event and using an array. But I really don't see the benefit. I think ranman nailed it succinctly with 'difficult and awkward'.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Auto Find Combo Box List
    By raychow22 in forum Forms
    Replies: 0
    Last Post: 09-01-2017, 10:22 AM
  2. Replies: 6
    Last Post: 02-27-2017, 09:06 AM
  3. Replies: 9
    Last Post: 04-01-2014, 04:29 PM
  4. Replies: 2
    Last Post: 06-20-2012, 09:49 PM
  5. auto populate combo field?
    By myboii in forum Access
    Replies: 8
    Last Post: 07-09-2010, 05:46 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