Search the web
Sign In
New User? Sign Up
VisualBasic_Official · Visual Basic . VB.net . VBS . ASP.net
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Arraylist   Message List  
Reply | Forward Message #9465 of 9530 |
Re: Arraylist

Your problem is in the followin line

For serial = 0 To count


Should be

For serial = 0 To count -1



--- In VisualBasic_Official@yahoogroups.com, "mary369_99" <honeypot4u@...>
wrote:
>
> Greetings
>
> I have to generate box, bundle and serial numbers as identifiers for a Store
Room System. I tried using an arraylist but got an error that:
> "Index was out of range. Must be non-negative and less than the size of the
collection. Parameter name: index"
>
> I am using 3 loops (box, bundle and serial) and want to store the values in
the arraylist. My code is as follows:
>
> Dim box, bundle, serial, count As Integer
>
> Dim SerialNum As New ArrayList(4)
>
> count = CInt(TxtSerial.Text)
>
>
> For serial = 0 To count
> Do Until serial = count
> serial = serial + 1
> SerialNum(1).Add(box).ToString()
> SerialNum(2).add(bundle).ToString()
> SerialNum(3).add(serial).ToString()
> GridView1.DataSource = SerialNum
> GridView1.DataBind()
> ' For batch = 1 To 80
> 'For box = 1 To count / 400
> 'Next
> ' Next
> Loop
> Next
>
> I get an error on this line:
> SerialNum(1).Add(box).ToString()
>
> A box must hold 500 serials. 100 forms in the box will have the same batch
number. Serial will be unique for every form
>
> Please assist.
>
> Regards
>





Sat Jul 11, 2009 2:07 am

mgaft1
Online Now Online Now

Forward
Message #9465 of 9530 |
Expand Messages Author Sort by Date

Greetings I have to generate box, bundle and serial numbers as identifiers for a Store Room System. I tried using an arraylist but got an error that: "Index...
mary369_99
Offline Send Email
Jun 18, 2009
5:11 pm

Hi I modified the code, but still getting the error: Dim box, bundle, serial, count As Integer Dim SerialNum As New ArrayList(4) count = CInt(TxtSerial.Text) ...
mary369_99
Offline Send Email
Jun 19, 2009
6:08 pm

can any one plz tell me the visual basic codes that are written in MS access, for event building???? Atleast three examples ...
hira gulzar
papa_ki_pari...
Online Now Send Email
Jun 29, 2009
4:14 pm

Your problem is in the followin line For serial = 0 To count Should be For serial = 0 To count -1...
mgaft1
Online Now
Jul 11, 2009
2:08 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help