Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append values from a Listbox to a Table.

Status
Not open for further replies.

olushow

MIS
Jul 26, 2006
84
US
Scenario,

Initially I had a form with approximately 40 combo boxes, based on a suggestion from another discussion group(actually Microsofts support group), I decided to use two listboxes, one text box for the batch number and two command buttons (one to close the form, the other to append the contents of the 2nd listbox to a particular table (tblBatch).

What I need to do is to be able to append this data to a tblBatch.

The reason for so many combo boxes is because of a particlar batch process that may have 15 procedures attached to it or 40. What we are ultimately trying to do is figure out who has been trained on these procedures.



Since I have now created the listboxes, and can move data freely between both listboxes, I now want to be able to append the values in the 2nd listbox to the Batch Table(tblBatch). I still have my form with the 40 combo boxes if this doesn't work out, but I figured that this will be better option for the user.

I'd like to think that my database has been designed properly, the problem is that we have very complex business processes.
 



Hi,

You might get a better response if you post in Microsoft: Access Modules (VBA Coding) forum705

Skip,

[glasses] [red][/red]
[tongue]
 
Code:
Private Sub Command1_Click()
Dim n As Integer
For n = 0 To List2.ListCount - 1
   db.Execute _
   "INSERT INTO tblBatch(SomeField) Values('" & List2.List(n) & "')"
Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top