Adding to List Box

  • Thread starter Thread starter Alex
  • Start date Start date
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
 
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
 
Back
Top