What do you mean by that? Is it possible to transfer all data to the new table?
What do you mean by that? Is it possible to transfer all data to the new table?
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.
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.
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.
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
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.