ADD ITEMS TO LIST BOX ACCESS 2000

A

Alex

Hi, I want to be able to type in a value in a text box and
hit CMDADD to add it in the List Box(access doesnt have
the .additem function darn)..From there I run a
report based on those values in the list box(I got that
part) My problem is in access 2000 in vb how do u for
example add green to the list box then add Red..I dont
want to replace it..I want to add on to it. Please
Help..Thanks....
 
G

Guest

that's not what I want to do....I just want to be able to
use VB coding to add whatever I put in the text box to the
list box...thanks though
 
D

Duane Hookom

Do you realize that the value you add will not persist after the form has
been closed? If this is ok then add the text to the RowSource property of
the combo box

Private Sub txtTextToAdd_AfterUpdate()
If InStr(Me.cboColors.RowSource, Me.txtTextToAdd) = 0 Then
Me.cboColors.RowSource = Me.cboColors.RowSource & _
";""" & Me.txtTextToAdd & """"
End If
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

Top