List

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I'm using a list box, and I have to add value to the list using the code,
how can I do it

I'm using Access 2000

I know in Access XP there is the method AddItem but I didn't find it in 2000

Thanks
 
Hi

I'm using a list box, and I have to add value to the list using the code,
how can I do it

I'm using Access 2000

I know in Access XP there is the method AddItem but I didn't find it in 2000

Thanks

Me.ListBox.RowSource = Me.ListBox.RowSource & ";'NewValue'"

if RowSourceType= "Value List"
 
Hi Andi

I don't want the data like this but as a data in a list

not: Student_1;Student_2;Student_3

but:
Student_1
Student_2
Student_3

because I want the user to be able to open the form of each Student buy
double cliking on the student ID

Thanks
 
Hi Andi

I don't want the data like this but as a data in a list

not: Student_1;Student_2;Student_3

but:
Student_1
Student_2
Student_3
look in Rowsource and post what is there
 
Hi Andi

My code is:


For i = 0 To d.Count - 1 'Iteration in the table of student
If Forms!Frm_Student!lstStudentID.ListCount = 0 Then
Forms!Frm_Student!lstStudentID.RowSource = a(i)
Else
Forms!Frm_Student!lstStudentID.AddItem= a(i) 'IN ACCESS
2002 NOT WORKING WITH ACCESS 2000
End If
end if
Next

Where a(i) : data I want to add

What you suggest will be

Forms!Frm_Student!lstStudentID.RowSource =
Forms!Frm_Student!lstStudentID.RowSource & ";" & a(i)
If I use what you suggest in your first post the RowSource data is:

ID_12;ID_13;ID_25;ID_40

I want in my list box:
ID_12
ID_13
ID_25
ID_40

Thank you very much
 
On Wed, 19 Jan 2005 09:53:13 -0800, "Hermione"

you have an array a()

if yes then

Forms!Frm_Student!lstStudentID.RowSourceType= "Value List"
Forms!Frm_Student!lstStudentID.RowSource=join(a,";")
 
Thank you very much Andi

Andi Mayer said:
On Wed, 19 Jan 2005 09:53:13 -0800, "Hermione"

you have an array a()

if yes then

Forms!Frm_Student!lstStudentID.RowSourceType= "Value List"
Forms!Frm_Student!lstStudentID.RowSource=join(a,";")
 
Back
Top