Page 3 of 3 FirstFirst 123
Results 31 to 36 of 36
  1. #31
    Dachbo is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    42

    What do you mean by that? Is it possible to transfer all data to the new table?

  2. #32
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    I don't understand what you are doing. Why transfer 'all data'? Why does all employee info need to be in another table?
    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.

  3. #33
    Dachbo is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    42
    not all employee info but more than just the EMPLOYEE_ID. I have a database with all employees and I want to append only those employees to the other table, which I have selected in the listbox.

  4. #34
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Combobox can have multiple columns. Include EmployeeID and name fields in the combobox RowSource. INSERT action can reference columns of combobox by index, index begins with 0.

    CurrentDb.Execute "INSERT INTO tablename(EmpID, LastName, FirstName) VALUES(" & Me.combobox & ", '" & Me.combobox.Column(1) & "', '" & Me.combobox.Column(2) & "')"
    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.

  5. #35
    Dachbo is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    42
    thanks that works.

    But now I figured out a new problem.

    When I select two entries, the first entry I select will be stored twice and the second one is not being stored in the new table.

    When I select A and than B, A and A will be stored. When I select B and than A, B and B will be stored.

    And when I only select B and store it in the table and after that I select only A and I want to store it in the table, not the A will be stored but the a B again.

    I have to clear the list box between the selections and than it stores the B and the A.
    I would like to be able to store as much entries as I want to

  6. #36
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Sorry, the INSERT should be:

    CurrentDb.Execute "INSERT INTO tablename(EmpID, LastName, FirstName) VALUES(" & Me.combobox.Column(0, varItem) & ", '" & Me.combobox.Column(1, varItem) & "', '" & Me.combobox.Column(2, varitem) & "')"

    http://allenbrowne.com/ser-50.html
    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.

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. How can you have a multi selectable form?
    By techtony in forum Forms
    Replies: 4
    Last Post: 08-07-2014, 11:30 PM
  2. Replies: 5
    Last Post: 08-20-2012, 11:11 PM
  3. Combo Box to selectable
    By Paul1762 in forum Forms
    Replies: 11
    Last Post: 08-15-2011, 11:05 AM
  4. non-selectable combo box
    By Ted C in forum Forms
    Replies: 1
    Last Post: 06-22-2010, 03:22 PM
  5. Date Selectable limitations
    By Robert_Clash in forum Access
    Replies: 0
    Last Post: 11-27-2007, 09:00 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