Adding to List Box

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..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
 
S

Stewart Tanner

Alex,

this can be done if the list box row source is a value list.

in you cmdAdd clck event you would do something like

dim strRowSource as string

' check for existing values in list box
if len(lstReportCriteria.rowsource) > 0 then
strRowSource = lstReportCriteria.rowsource & ";" & TextBox
else
strRowSource = TextBox
end if
lstReportCriteria.requery

Cheers
Stewart
 

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

Similar Threads

Adding From Text Box to List BOx 2
ADD ITEMS TO LIST BOX ACCESS 2000 3
Need help in list box 4
.AddItem 14
Limiting list box selection 2
List Box Synch 5
List Box 2
add values to limit to list 2

Top