Results 1 to 3 of 3
  1. #1
    Atoga is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    21

    adding items selected from a listbox to a junctiontable


    Hi All, Can you help me with this issue, please?: I am just about to write a code that adds items selected from a listbox to a junctiontable. I would like to be able to add one or more Skills from a listbox to a Course/Qualification. The listbox is on pop-up form that comes up when a certain Course/Qualification is selected in a combobox on another form. After selecting Skill(s) from the listbox, I would like to click on Add to Course/Qualification button and by this add the selected skills to the Junctiontable `CourseQualSkill` So I would like to add the selected Skill(s) to the Course/Qualification that was selected from the combobox in the starting form. I guess the code would look something like this,but I dont know what to write to Append jcntblCourseQualSkill.:

    Code:
    Private Sub cmdAddSkilltoCourseQual_Click()
    For x = 0 To Me.lstSkillstoAddbyCourseQual.ListCount - 1
            If Me.lstSkillstoAddbyCourseQual.Selected(x) = True Then
                'Append jcntblCourseQualSkill
             End If
        Next x
    End Sub

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    I find the 'no code' approach is easier.
    list box 1 is the list of available options to pIck
    list box 2 is the picked items.
    when user dbl clicks list1, execute an append qry that puts the item in a table (list2)
    when done, join the picked list to whatever needed.

    User can delete from list2 with a delete qry.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    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: 16
    Last Post: 03-31-2020, 10:19 AM
  2. Replies: 1
    Last Post: 01-22-2015, 10:55 AM
  3. Replies: 12
    Last Post: 01-08-2014, 05:15 PM
  4. Replies: 7
    Last Post: 02-01-2013, 02:58 PM
  5. Selected items in listbox
    By tomodachi in forum Access
    Replies: 1
    Last Post: 09-09-2010, 01:14 PM

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