Results 1 to 4 of 4
  1. #1
    lhanley22 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2021
    Posts
    7

    List Box on Data Entry Form

    Hello, I have created a data entry form for my data base. (Show in First Image). I have a keyword listbox that is a multi select list box. I want to be able to select many values in this list box and then have the selections be entered as a string of text in a field of my database (comma separated Key words). An example of what I want to see in my database is in the second picture. I don't want to use the Lookup Wizard, as I wont be able to use my search query with that. A previous intern at my company did this but he's not around and I'm having trouble reverse engineering his work. Maybe there's a relatively simple way to do this.....many thanks
    Click image for larger version. 

Name:	entryformexample.jpg 
Views:	22 
Size:	62.1 KB 
ID:	45817Click image for larger version. 

Name:	kwordexample.jpg 
Views:	21 
Size:	93.1 KB 
ID:	45818

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Is this not a continuation of this

    https://www.accessforums.net/showthread.php?t=84043
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    lhanley22 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2021
    Posts
    7
    Yes it is. Should have mentioned that. I have been able to search on a text of keywords (typed in manually one by one with commas). I'm trying to tackle this from the data entry side now, as other employees will be have to use the data entry form and they'd rather not have to type one by one.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If I understand the goal now, you'll want to loop over the selected items in the listbox and build an IN clause. See

    https://docs.microsoft.com/en-us/off....itemsselected

    When you get each item, you append the item (text or id, can't tell which from your pics but probably not the ID number of the record) & a comma. You might have to refer to to the listbox column (e.g. when the listbox is bound to a numeric field) or stick with the ItemsSelected and write your sql statement so that it uses the numeric field instead. When the loop is done you remove the comma and last space from the string variable holding those values and build the rest of the sql statement in code then execute it. Have to go out now so I cannot delve into this too much further at present. Start with developing code that iterates over your selected items.

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

Similar Threads

  1. Restrict data entry to preset list
    By chrisfl in forum Forms
    Replies: 2
    Last Post: 06-28-2013, 01:16 PM
  2. Replies: 2
    Last Post: 04-05-2012, 08:39 PM
  3. Replies: 6
    Last Post: 04-27-2011, 06:12 AM
  4. Data Entry Form: Retain Selected List Box Value
    By William McKinley in forum Forms
    Replies: 1
    Last Post: 11-05-2010, 10:14 AM
  5. Combo box/list for data entry.
    By geoffishere in forum Forms
    Replies: 1
    Last Post: 03-13-2010, 04:16 AM

Tags for this Thread

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