Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Listbox.List


Message #1 by "Williams, Sean" <swilliams@g...> on Thu, 24 Oct 2002 14:17:06 +0100
I have solved this by using an OLE inserted as an Excel object.  This then
allows me to select the range I want and let that equal the array.

Amazing, after moving from Excel to VB,  I was hoping I wouldn't have to
need to go back....

At least I wasn't going completely mad this afternoon....


regards

Sean
 -----Original Message-----
From: 	Cremieux, Judith K. [mailto:Judith.Cremieux@i...] 
Sent:	Thursday 24 October 2002 18:30
To:	professional vb
Subject:	[pro_vb] RE: Listbox.List

No you're right - the actual sample code is for a combo box and is similar
to what is done for list boxes. It just happens to concatenate parts of the
array in this application. It also sets the ItemData to an item in the
array.
The point Keith and I were making is that so far as we knew you would have
to loop thru the array using the AddItem method and it seems thats' not what
you want to do.

> -----Original Message-----
> From:	Williams, Sean [SMTP:swilliams@g...]
> Sent:	Thursday, October 24, 2002 9:55 AM
> To:	professional vb
> Subject:	[pro_vb] RE: Listbox.List
> 
> I have just been thinking   this is not using multi column Listboxes
> 
> All you are doing is adding 1 line  and  concatenating 2 fields   
> 
> I want to enter 6 fields however many times   and I need them to be
separate
> so that I can call each field if needed
> 
> Regards
> Sean 
> 
> 
>  -----Original Message-----
> From: 	Cremieux, Judith K. [mailto:Judith.Cremieux@i...] 
> Sent:	Thursday 24 October 2002 15:52
> To:	professional vb
> Subject:	[pro_vb] RE: Listbox.List
> 
> All of our lisboxes/combo boxes filled from arrays are also done as Keith
> suggested - one at a time
> such as:
> With cboMain(fSTATUS)
>         If IsArray(vArray) Then
>             j = UBound(vArray, 2)
>             For i = 0 To j
>                     .AddItem Trim$(vArray(0, i) & "") & " " &
> Trim$(vArray(1, i) & "")
>                     .ItemData(.NewIndex) = Trim$(vArray(0, i))
> 
>             Next
>             
>         End If
>     End With
> 
> 
> > -----Original Message-----
> > From:	Williams, Sean [SMTP:swilliams@g...]
> > Sent:	Thursday, October 24, 2002 8:17 AM
> > To:	professional vb
> > Subject:	[pro_vb] Listbox.List
> > 
> > Afternoon All
> > '
> > 
> > Ok  I now have a headache from this and it MUST be simple
> > 
> > 
> > I have a two dimensional array to populate into a list box
> > 
> > 
> > Excel VBA is     userform1.listbox1.list = MyArray
> > 
> > 
> > What is it in VB ??
> > 
> > Seems like everything I have tried fails    
> > 
> > Eg
> >         arInbound(0, 0) = (.Fields(3))
> >         arInbound(0, 1) = (.Fields(4))
> >         arInbound(0, 2) = (.Fields(5))
> >         arInbound(0, 3) = (.Fields(6))
> >         arInbound(0, 4) = (.Fields(7))
> >         arInbound(0, 5) = (.Fields(8))
> > 
> >     
> >    Form1.List1.List  = arInbound
> > 
> > 
> > Any Suggestions ???
> > 
> > Regards
> > Sean
> > 
> > 
> > 
> > 
> > 
> > ---
> > Visual C# - A Guide for VB6 Developers
> > This book will make it easy to transfer your skills 
> > from Visual Basic 6 to C#, the language of choice 
> > of the .NET Framework.
> > http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
> > 
> 
> 
> ---
> Visual C# - A Guide for VB6 Developers
> This book will make it easy to transfer your skills 
> from Visual Basic 6 to C#, the language of choice 
> of the .NET Framework.
> http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
> 
> 
> 
> 
> ---
> Visual C# - A Guide for VB6 Developers
> This book will make it easy to transfer your skills 
> from Visual Basic 6 to C#, the language of choice 
> of the .NET Framework.
> http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059
> 


---
Visual C# - A Guide for VB6 Developers
This book will make it easy to transfer your skills 
from Visual Basic 6 to C#, the language of choice 
of the .NET Framework.
http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059



  Return to Index