Results 1 to 6 of 6
  1. #1
    sud2017 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    148

    Append Query running from a listbox

    Hi Experts,

    In my form, I have a listbox containing various opportunities, which are, once selected, append records for different OppIDs to a table.

    User selects multiple opps (one at a time) from the listbox. Originally, I was desiring for somethig like multivalue checkboxes but read in forums that it is problematic.

    Currently user selects each opp individually and then click save button (to run append query for that opp) but this is bit time consuming as i have many opps in the listbox.

    I also tried running append query from on-click event of listbox, so everytime user selects an opportunity, values are appended without clicking save button (to run append query) each time. This was working fine for sometime until it started showing an error message of key violations, so i have switched back to the single opp select and save approach, which as I said is really time consuming.



    Your advise to best approach this would be greatly appreciated. Thank you.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sud2017 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    148
    Thanks Paul. Looks like it will involve some coding. I have data appending from 2 tables and one user entered value appending from a FORM (same form where i am running the query), hence the code might get a bit complicated,considering my lack of coding knowledge.

    Currently I am running Append Query from OpenQuery macro. Before I really get into the coding as shown in your attached database, I am curious if there is any way to accomplish multiselect listbox to append record with my current Query and Macro based setup?

    Your time is much appreciated.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    I don't see how. Code is required to get the selected values from a multiselect listbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    sud2017 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    148
    Thanks again Paul. I will be digging into the code part soon and will request for help if there is any issue. Greatly appreciate your help.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    No problem, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 03-31-2016, 08:42 AM
  2. Clear Listbox after Running Report
    By Khatru in forum Forms
    Replies: 2
    Last Post: 03-27-2015, 04:57 PM
  3. How to turn off prompt when running append query from code
    By GraeagleBill in forum Programming
    Replies: 5
    Last Post: 07-22-2013, 03:35 PM
  4. running append query without showing some alertes
    By afshin in forum Programming
    Replies: 2
    Last Post: 11-10-2012, 10:49 AM
  5. Append Records using MultiSelect Listbox
    By Ted C in forum Programming
    Replies: 14
    Last Post: 03-15-2011, 01:25 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