code to add rows to combobox

  • Thread starter Thread starter JT
  • Start date Start date
J

JT

My form has 6 text boxes for the user to enter data.
Whatever data is entered into the text boxes should be a
new line on a combo box.

The combo box has 12 columns. One for each text box and
one is blank between each column with data. (The extra
columns help line up the data with the labels I'm using as
Headings.)

I'm having trouble with (1) getting the data from the text
boxes into columns. The only success I've had is getting
all of the data going down in column 1 instead of across
row 1.

and (2) each time the users enter data in this form a
different number of lines will be added to the combobox.
I'm having trouble adding a 2nd, 3rd 4th, etc. lines to
the combobox.

Any suggestions or help with this coding would be great.
Thanks for the help........
 
Private Sub CommandButton1_Click()
with listbox1
.AddItem Textbox1.Value
for i = 1 to 5
.list(.listcount-1, i * 2 ) = _
me.controls("Textbox" & i + 1).Value
Next
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top