Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Array Index


I am getting an Array error when i run my code. The error and code is;


Code:

Invlaid Property Array index.

Sub vsfActionsSetup()

Dim Z As Integer

For Z = 0 To 5

vsfActions.ColHidden(Z) = True

Next Z



It is getting stuck on the vsf.Actions.ColHidden(z) line. I dont know how to change my array index??




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Display Value Of Index (as Opposed To Index #) In An Array?
Hello All! I hope someone can help me as I am pretty new to programming. I actually have a few other questions (but will post seperately), but here is my first question:

I have declared an array and gave it 20 values

Code:
Dim score() As Double = {59, 60, 65, 75, 56, 90, 66, 62, 98, 72, 95, 71, 63, 77, 65, 77, 65, 50, 85, 62}


Then, I have written code to make each of these values correspond with a letter (grade). However, when it displays in the listbox, it isn't showing the number in the index, but rather the placement of that number. For example, it's showing:
0 B
1 C
2 C
etc...

But I want it to display:
59 B
60 C
65 C
etc...

Here is the code of the For loop I'm currently using:

Code:
For i As Double = 0 To num
If score(i) >= m + (1.5 * s) Then
ListBox1.Items.Add(i & " " & "A")
ElseIf score(i) >= m + (0.5 * s) And score(i) < m + (1.5 * s) Then
ListBox1.Items.Add(i & " " & "B")
ElseIf score(i) >= m - (0.5 * s) And score(i) < m + (0.5 * s) Then
ListBox1.Items.Add(i & " " & "C")
ElseIf m - (1.5 * s * score(i)) <= m - (0.5 * s) Then
ListBox1.Items.Add(i & " " & "D")
ElseIf score(i) < m - (1.5 * s) Then
ListBox1.Items.Add(i & " " & "F")
End If
Next


Any help is greatly appreciated!

Ladyrhedd

Feeding 1-d Array Length N Into N-d Array As Index-list
Code:
Dim a(1 To 10, 1 To 10, 1 To 10) As Long
Dim b As Long
Dim c As Variant

'1
b = a(1, 1, 1)

'2
c = Array(1, 1, 1)
b = a(c)

The example here is silly, but as the subject line suggests, in case a is not static but the dimensionality is changed dynamically, it would be useful to be able to use another array as an "index-list" to pick an element in a. In a way, it's the analogue of a ParamArray for a function...

'2, as it is, obviously gives me an error. The only environment that I know this works in is Mathematica, which allows you to "unroll" an array into a number sequence that can be fed into anything that takes numeric parameters.

I guess I could always do this using MSScript, but I thought maybe there is a more direct way!?

Thanks in advance

Can You Reset The Array Index Value On A Visually Created Array In VB6?
Hi,
I'm trying to avoid hand resetting each .Index property in my 500 member array of drop down menus. I had them in a picture box that I copied on to several forms so the user can go to the next page of arrays and then the next, entering info the whole time. The copied array doesn't automatically start at index of 301, for example, it always appears as 0 on every form. I want it to be linked with continuous values so I can manipulate the array globally across pages in the same project without loading anything into a db. Help! I tried making a button that would reset the index values and I got a "You are trying to change a read only property" error. So, am I doomed to spend a Saturday pointing and clicking? Help this newbie, guys! please!

Here's the code I tried on the button that will reset everything:

Private Sub cmdResetIndices_Click()
Dim i As Integer

   Do While (i <= 16)
    lblNumbers(i).Index = (lblNumbers(i).Index + 16) & _
    lblStimWord(i).Index = (lblStimWord(i).Index + 16) & _
    txtComments(i).Index = (txtComments(i).Index + 16) & _
        i = i + 1
    i = 0
    Do While (i <= 102)
        lblWordErrors(i).Index = (lblWordErrors(i).Index + 95) & _
            i = i + 1
End Sub

______________________________________________________

This code gave me nutt'nn

Array Index Value
Is there a way to identify the index value of a specific text box in an array of text boxes?

I have an application with 14 text boxes in an array. If a user keys in a function key I want to identify the specific text box and make a calculation using that specific text boxes content.

End Of Index Of Array
What do you mean by that?

Variable Array Index
Is there a way to get the index of an array. I have an array variable and need to use in a select case with the index being the case. I hope this is clear?

I know this will not work but this is want I need to do.

Code:
Dim thisarray(8) As String

Select Case thisarray.Index
Case 3
'do somthing here
Case 5
'and do somthing else herr
End Select

Identifying An Array Index
I have a form that has seven control arrays, each with 14 controls. One of the arrays is a check box. If a user checks that box I want to capture (identify) the index and use it to generate a message.

If I use the For and Next, the first occurence will generate one message box, the second will result in two message boxes, etc. which I do not want. If the user clicks on a check box I want to be able to refer to the content of other controls with the same index in my message.

Is this possible? I have tried several different approached which either lead to an error or an incorrect number being returned.

Thanks in advance.

Inproper Array Index
I'm trying to create a program where it loads setences from a datafile into a listbox and from there the user can add, delete or modify the setences. I've been trying to get the user to delete the sentences and modify them but I always get an error.... Can someone tell me what I'm doing wrong and how to fix it? And.. do I need the whole filename to open the file

Private Sub cmdDel_Click()
Dim lvlSen, newSen As String
intFileNum = FreeFile
If lvlNum = 1 Then
Open "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPTlvl1.txt" For Input As #intFileNum
intNewFileNum = FreeFile
Open "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPT emplvl.txt" For Append As #intNewFileNum
ElseIf lvlNum = 2 Then
Open "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPTlvl2.txt" For Input As #intFileNum
intNewFileNum = FreeFile
Open "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPT emplvl.txt" For Append As #intNewFileNum
ElseIf lvlNum = 3 Then
Open "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPTlvl3.txt" For Input As #intFileNum
intNewFileNum = FreeFile
Open "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPT emplvl.txt" For Append As #intNewFileNum
ElseIf lvlNum = 4 Then
Open "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPTlvl4.txt" For Input As #intFileNum
intNewFileNum = FreeFile
Open "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPT emplvl.txt" For Append As #intNewFileNum
Else
End If
Do While Not EOF(intFileNum)
Input #intFileNum, lvlSen
a = a + 1
If textbox.Selected(a) <> textbox.ItemData(a) Then 'updates
lvlSen = textbox.Text
Write #intNewFileNum, lvlSen
ElseIf textbox.Selected(a) = textbox.ItemData(a) Then ' delete here
textbox.RemoveItem (a)
End If
Loop
Close #intNewFileNum
Close #intFileNum
Kill "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPTlvl1.txt"
Name "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPT emplvl.txt" As "F:IBMEDUCHOMEDIRStudentsNGOJ____.__Sentence CPTCPTlvl1.txt"
End Sub

Remove Array() By Index
Code:
For i = 0 To UBound(FilterList) - 1
If LCase(pA(1)) = LCase(FilterList(i)) Then
SendW "Removed filter: " & FilterList(i), strAccount
FilterList(i) = FilterList(i + 1)
ReDim Preserve FilterList(UBound(FilterList) - 1)
End If
Next i
My array is as follows:

Code:
Feany
http
gay
bob
stealth
When using the above code to remove "Feany" it just replaces Feany w/http.
When I remove "stealth" it works & when I remove "bob" it works.
When I remove http it removes the "stealth", & just replaces the "http" w/another "gay"

Any ideas?

Sorting With Index Array.
My latest project is a little fun doodad for personal use, but I can't seem to get the most essential part of it working. =/

Here's the setup - I have an array which includes three values per entry - 'Name', 'Particles', and 'SortOrder'.

Now, I want to sort the values in 'SortOrder' (a Single) so that the entry with the highest 'Particles' has the highest SortOrder, and the entry with the lowest Particles has the lowest SortOrder.

But darnit, I can't seem to work out a sort algorithm that would do just that. =/

Here's what I've coked up so far:
Code:
Public Sub sortentries()
Dim iCount As Integer
Dim i As Integer
Dim j As Integer
Dim temp As String

iCount = NumberUsers

For j = 0 To iCount - 1
For i = 1 To iCount - 1
If (UserReports(i).totalparticles > UserReports(i + 1).totalparticles) And _
(UserReports(i).SortOrder < UserReports(i + 1).SortOrder) Then
temp = UserReports(i + 1).SortOrder
UserReports(i + 1).SortOrder = UserReports(i).SortOrder
UserReports(i).SortOrder = temp
End If
Next i
Next j

End Sub
Obviously, I'm doing something wrong, because the results are horribly mangled. Any suggestions?

How To Delete Index From Array?
how do i delete an index from an array and move all indexes above it down to fill in the gap?

ie- ive an array temp(0 to 5) and want to delete temp(3).
i want temp(4) to become temp(3), temp(5) to become temp(4) and resizing to temp(0 to 4)

is there an easy way to do this?

Control Array Index?
Is there anyway that you can set up a control array so that it has 2 Index's? ie. If you had a 10 by 10 grid of Labels or something and you wanted an index for the columns and an index for the rows.

Refering To An Array's Index
I have two array's that coincide and am wondering if it's possible to use one array's Index to refer to another array... i wrote some quick sample code below to try and explain better what im trying to do.


Public shindex as Integer

Private Sub array1_Click(Index As Integer)
shindex = array1(Index)
End Sub

Private Sub Button1_Click()
msgtxt(shindex).Caption = "BLAH BLAH BLAH"
End Sup

any help would be greatly appreciated. thank you.

Retrieve Index From An Array
Hi

Could anyone please tell me how to store a certain index value in an integer?

I am trying to retrieve the index of the selected radio button from an array of radio buttons.


Thanks

Re-Index Control Array
I have a control array of pictureboxes. These pictureboxes are arranged vertically stacked on top of each other. The user has the ability to select one of the pictureboxes and delete it. My question is, how do I re index the control array so it still shows them stacked on top of each other (no gaps in between the pictureboxes, like if I simply unloaded the picturebox they deleted).

Index A Variable Without Array -is This Possible?
Hello,

I have existing code like

a1 = 0
a2 = 0
a3 = 0
.
.
.
a300 = 0

No I try to set the variables to 0 in a for to next loop bacause I have not more than 1000 lines per script.

for x = 1 to 300
"a" & x = 0
next x

this is not running well I know - it is just the example what I want to do.
I have no posibility to create a array. lika a(x).

So im looking for a funktion or what ever what can convert the "a" & x string to a variable name. any ideas?


thanks for help

regards check_it_now

Index Of Element In Array
Hi
I have an array of integer
int1(10) as integer

How can I know programmatically the index of a specific element?
for example int1={1,9,6,24,32..}

How can i know by code the index of the element 24?
(in this case it's 3)

thanks

Non-numeric Array Index?
VB Code:
arr("index1") = "value1"Dim str as Stringstr = "index2" 'could be anything!arr(str) = "value2"

Is there some way to do this?
Currently I am doing it via

VB Code:
Type TBlah    Index As String    Value As StringEnd TypeDim arr() as TBlaharr(0).Index = "index1"arr(0).Value = "value1"arr(1).Index = "index2"arr(1).Value = "value2"

But then when I want to grab the item with the Index="index1" I have to loop though array untill its found.

Array Already Has Control At Index ' 0 '
Ok on my program I put a Winsock Icon on the Iface went too set the (Name) To Socket and i get this Big Red X --- Array Already has Control at Index ' 0 '....

Now in the Example Code i'm learning from on the Winsock Icon on thier Iface in the properties Box has (Name) Socket , Index 0...

but when i do it i get that error can someone help me figure out whats going on?

Thxs in Advance...

How To Get The Max Index In A Control Array
Hi,
I have a form with numerous control arrays. Is there a way to work out the maximum index for a particular control array?
Thanks

List Index Array Whatever It Is
What i wanna do is use a listbox
But i need to know how to make an integer or whatever so like.

basically this is for a playlist for a good mp3 player.
lets say i have 10 items in the list box
i need to beable to save data about each one in the background

like dim listboxdata as (what should it be?)
so i can save the location and easily get it like
listboxdata(1)
gets me the location for that listitem that ive stored.

Right now the way im doing it is with 2 listboxes.
One that loads all the locations + filename
and the other all the idv1v3 2v3 tags..

It works alright but is kind of slow i think this way would work alot better could anyone help me out?

thanks

Adjust For Index Array
Here is some example code. Can anyone suggest how I would determine which index to use in the function if Picture1 was a control array?


VB Code:
Private Sub Command1_Click()    CCol GetControlName("Picture1")    'If this was an array we would pass Picture1(0) instead etc.End Sub Private Sub CCol(PicBox As PictureBox)    PicBox.BackColor = vbRedEnd Sub Public Function GetControlName(ByRef ControlName As String) As Control    Dim tempControl As Control     For Each tempControl In Me.Controls        If tempControl.Name = ControlName Then           Set GetControlName = tempControl           Exit Function    End If    NextEnd Function

Array Index Always A Number???
In other languages, you can have an array with indices that are letters, days of the week, or anything else the designer desires. Is it possible in VB? How would it be done?

For example,
DaysoftheWeek(Monday)=10
DaysoftheWeek(Tuesday)=5
...

Do we use enumeration to store the items that you want to use as indices? Thank you.

Re-Index Control Array?
I have a control array that controls will be added to and deleted from at runtime. After deleting controls I need to re-index them to keep every thing in order. How would I do this?

Command As The Index Of An Array
Is that allowed if the Command is an integer?, because when I do it Command$ always comes up as EMPTY.

Customize Array Index
Is there any way to customize an array index to what i want to call it.
For example:

dim strStudent(FName, LName, Address) as String

Although, I know by placing a comma in there VB interprets it as another dimension of the array, the idea I'm trying to convey is there.

Thanks in advance.
Angelo

Index To Image Array
Hi

I am using an array of images and I want each image to have an index number or any other way to find it and use it.To make it  more clear:

Image(i).left=500
Image(i).top=600

Like I can find that image searching which image has top position 600, is there another way to assign a number, like the top and left position, so I can find it?

Array Index {VSFlexGrid Control}
--------------------------------------------------------------------------------

I am getting an Array error 381 when i run my code. The error and code is;


Code:

Code:
Invlaid Property Array index.

Sub vsfActionsSetup()

Dim Z As Integer

For Z = 0 To 5

vsfActions.ColHidden(Z) = True

Next Z
It is getting stuck on the vsf.Actions.ColHidden(z) line. I dont know how to change my array index??

VBA: Array Index Count And Sorting
I read the whole explaination about Arrays from the Standards and Pratices section and made an procedure which lets a array be filled dynamicly.

Filling the array is something like this:

Code:
Dim aArray() As String
Dim iCount As Integer
Dim iNum As Integer

Let iCount = getTotalMembers()

ReDim aArray(iCount, 1) As String
Do While iNum >= iCount
Let aArray(iNum, 0) = cValue1
Let aArray(iNum, 1) = cValue2
Let iNum = iNum + 1
Loop

My question is how I can let another function know what X is for aArray(X, 1) without having to pass on the iCount integer.

My second question is if there is a way to sort the array on the for example the first column...

To explain why I need this:
cValue1 contains a persons Last Names while cValue2 will contain the First Name. After the array is build I would like to sort it on Last Names.

&gt;&gt; How To Determinate The Index Of An Item In Array
Hi! I have 2 arrays called "id()" and "name()" and when I assign a string value to the name array, I assign also an id.
so... i want to get the index by specifing the item in the "name" array like this:

1st item= "a" index = 0
2nd item = "b" index = 1

and if i want a function that determinate the index of an item by specifing the text in this case


thanks


simons

No Index Property In RTF Control Array
Hi,
I tried to find some information on this but a search on "rich text control array" does not return anything related. basicaly intelisense gives me item,count,ubound and lbound for my RTF array no index! The funny thing is if I double click it in IDE it gives me an index for the click event. Any suggestions ?
Mike

How Can I Declare An Array With Variable Index?
i try to create an array such as :

Dim x(i) as Double

however i value is input by the user.

Total Count Index For Array?
How do I get the total number of indices for variable array there are?

Len(variable) doesn't work

String As Index In A Property Array
Is it possible to index a property array with a string instead of a integer?
I've tried but I can't get it to work.
What I had in mind was something like this:

Code:
Public Property Let Matrix(Index As String, newMatrix As Variant)
mIMatrix(Index) = newMatrix
End Property
Public Property Get Matrix(Index As String) As Variant
Matrix = mIMatrix(Index)
End Property

Index/Control Array Question
Alright, pretty simple question. Is it possible to change a control array index number to something that it isn't already? These objects being loaded in the control array are at runtime, and are image boxes. For instance say I have imgobjects(4) and i want it to be named imgobjects(900)

Now the more complex question. If so, how?

Setting 1-dim. Arrays To 1st Index Of 2-dim. Array
I may just be brainfarting today, but I can't figure out a way to easily set a 1-dimension array to the first index of a 2-dimension dynamic array, i.e.


Code:
Dim l_dblDynamicArray()
Dim l_dblOneDimArray()

ReDim l_dblDynamicArray(2,100)

l_dblOneDimArray() = l_dblDynamicArray(1)

Note that variable types don't seem to matter. Also, I know I can easily loop through, but I am trying to clean up some code. There MUST be a way!

Invalid Property Array Index
Code:
Dim i As Integer


Set j_ObjCom = New ADODB.Command
With j_ObjCom
.ActiveConnection = j_Objcn
.CommandText = "Select * from vieMatrixcolor where Style = '" & cboStyle.Text & "'"
.Execute
End With

Set j_Objrs = New ADODB.Recordset
With j_Objrs
.ActiveConnection = j_Objcn
.CursorLocation = adUseClient
.CursorType = openstatic
.Open j_ObjCom

End With


For i = 1 To j_Objrs.RecordCount - 1
'error stops on this line
vsfMatrix.TextMatrix(i, 0) = Trim(j_Objrs("Color").Value)
j_Objrs.MoveNext
Next


it shows the first color then it stops at that line

Invalid Property Array Index
I am trying to populate the itemdata of a list box, when debugging i notice that the code:-

LstMake.ItemData(LstMake.ListCount - 1) = recordset.Fields(0)

is highlighted and vb tells me that there is an invalid property array index,
can anyone see any error here??
or do i need to post you more code to understand the problem?

Invalid Property Array Index
Please help me with this code, I keep getting (invalid property array index) error .


VB Code:
Private Sub Get_All_Drives()On Error GoTo ErrHand     Dim sDriveName As String    sDriveName = String$(1, 0) 'Declare a Single length string        sDriveName = "A"    lstDrive.Clear   For i = 0 To 25        Select Case GetDriveType(sDriveName & ":")            'Case DRIVE_UNKNOWN             'Case DRIVE_DOES_NOT_EXIST                            Case DRIVE_REMOVABLE                lstDrive.AddItem (sDriveName) & vbTab & "-" & vbTab & "Floppy Drive"            Case DRIVE_FIXED                lstDrive.AddItem (sDriveName) & vbTab & "-" & vbTab & "Hard Disk Drive"            'Case DRIVE_REMOTE                       Case DRIVE_CDROM                lstDrive.AddItem (sDriveName) & vbTab & "-" & vbTab & "CD-ROM Drive"                            'Case DRIVE_RAMDISK                    End Select        lstDrive.Selected(lstDrive.ListCount - 1) = True        sDriveName = Chr(Asc(sDriveName) + 1)    Next        Calc_Hidden_Drives     lstDrive.ListIndex = 0Exit SubErrHand:    MsgBox "Error Occurred while Retrieving Drive Details !!" & vbCrLf & "Procedure : Get_All_Drives " & vbCrLf & err.Description, vbCriticalEnd Sub

Store Data In 2d Array Without 2nd Index
I have a function that reads data from a file and stores it in an array:


VB Code:
For a = 0 To 15      Get #file_no, , flash_bank_data()   Next


however I need to change the storage array to 2d, e.g


VB Code:
Private flash_bank_data(15, FLASH_BANK_SIZE) As Byte


How can I modify the above code to work this this new array? The first index would be fixed so something like:


VB Code:
For a = 0 To 15      Get #file_no, , flash_bank_data(0, () )   Next


but this is the wrong syntax. Any ideas?

Using The Index Number Of An Item In An Array
Another easy one (sorry!) :-)

I am trying to use the number of the items in my array so that, say:

If ArrayOne (Item number is 1 or 2 of array) Then

Do this

If ArrayOne (Item number is 3 or 4 of array) Then

Do this

Etc...

Is it possible?
Thanks for reading, Chloe x

Invalid Property Array Index
lstWoord is a list and I want to remove all the selected items.
Why does this code don't work ?

For i = 0 To (lstWoord.ListCount - 1)
If lstWoord.Selected(i) Then lstWoord.RemoveItem (i)
Next i

Control Array Index Property
I have an assignment that has a control array of command buttons representing the seating plan of an aeroplane. How do I reference the index property of the control array from another form that is displayed once the command button is pressed?
I need this index property so I can calculate the position of the command button to store information in a corresponding 2D array. The control array is 4 cols by 8 rows. I know I have to use row=IndexNumber 4+1 and col=IndexNumber MOD 4+1. Any help appreciated. Sandra

How To Reuse A WInsock Array Index
I have a form with a wisock array on my problem is that I want to
reuse the index array number when the user disconnects but
all I get is 'Object already loaded' error the code is as follows


VB Code:
Private Sub WS_ConnectionRequest(Index As Integer, ByVal requestID As Long)If Index = 0 And blnFreeIndex = True Then   Load WS(intIndex)   'intIndex Public Integer   WS(intIndex).Accept requestID   Text1.Text = Text1.Text & Now & " Request from " & WS(intIndex).RemoteHostIP & " " & IndexElseIf Index = 0 Then    intMax = intMax + 1  ' intMax Public Integer    Load WS(intMax)    WS(intMax).Accept requestID    Text1.Text = Text1.Text & Now & " Request from" & WS(intMax).RemoteHostIP & " " & IndexEnd IfEnd Sub  Private Sub WS_DataArrival(Index As Integer, ByVal bytesTotal As Long)Dim strData As StringWS(Index).GetData strData                If strData = "endTrans" Then ' endTrans is the trigger to close the conection                    WS(Index).Close                    blnFreeIndex = True                    intIndex = Index  ' intIndex Public Integer                End IfText2.Text = Text2.Text & strData & " " & Index & vbCrLfEnd Sub


Any ideas would be a help

Invalid Property Array Index
I need to get rid of this error:

Run-Time error 381:
Invalid Property Array Index

This is the code that is generating it:

Private Sub List1_Click()

Dim z As Integer
For z = 0 To File1.ListCount
File1.Selected(z) = False
Next

End Sub

When I debug this part is highlighted:
File1.Selected(z) = False

The same error occurs when I change
Dim z As Integer to Dim z

I am going to continue trying to fix this, but any help will be appreciated!

Invalid Property Array Index
I am populating a drop down box and storing also adding an index.

I have added code for auto text complete in the item click event so if users start typing a word it will look to see if that value exists and selects it. If users use this feature I get the "Invalid Property array index" when I go through my save process...

Here is the code that errors out.
Code:intTypeID = cboType.ItemData(cboType.ListIndex)

It is almost like no click_Event was invoked. If user just select from the drop down I have no problems at all. Anyone have any ideas here for me?

Here is my auto complete code...

Code:strCurText = LCase(cboType.Text) 'Text Autocomplete Procedure
intCurTextLen = Len(strCurText)
If intCurTextLen - intOldTextLen = 1 Or (intCurTextLen = 1 And intCurTextLen > intOldTextLen) Then
   For intCounter = 0 To cboType.ListCount
     If strCurText = LCase(Left(cboType.List(intCounter), intCurTextLen)) Then
        Exit For
      End If
   Next

If intCounter <= cboType.ListCount And strCurText <> "" Then

For intLoopCtr = 0 To cboType.ListCount
    If cboType.List(intLoopCtr) = cboType.List(intCounter) Then
       Exit For
     End If
Next

cboType.ListIndex = intLoopCtr
cboType.SelStart = intCurTextLen
cboType.SelLength = Len(cboType.Text) - intCurTextLen
End If
End If
intOldTextLen = intCurTextLen



Edited by - Adobe on 3/19/2007 5:58:55 AM

Rearrange The Index In The Control Array
I use control array in my program for the users to add and remove textbox(es)
If the users add 10 textbox(es) and remove the 6th textbox, is there a way to rearrange the order of the index number without changing the content of the textbox(es)
Thx

Increment Array Index In Loop
Hi i have a groupWise email form i'm trying to attach files to. I've got most of it working, but i'm having bother attaching more than one file. To add more the one file i would use:

varAttach(0) = "c:/test.doc"
varAttach(1) = "c:/test2.doc"
...

So i want to count the records in tbl_attached where i'm storing the file locations and loop through the record set outputting the recordset value of location setting it against, varAttach(0), varAttach(1) etc.

Dim dbs As Database
Dim rst As Recordset
Dim strDBName As String
Dim strTable As String
   
strTable = "tbl_attachment"
strDBName = "E:email.mdb"
Set dbs = OpenDatabase(strDBName)
Set rst = dbs.OpenRecordset(strTable, dbOpenTable)
   
If rst.RecordCount > 0 Then
rst.MoveFirst
For vCount = 0 To rst.RecordCount
varAttach(vCount) = rst!location
rst.MoveNext
Next vCount
End If
rst.Close
Set rst = Nothing

Thanks

R

Call removeRecord



Edited by - AbbydonKrafts on 4/13/2007 6:56:39 AM

Passing An Index Array Within A Function
How would I pass an indexed array in a function to another function. Also how would I refer back to that function for set focus?

Copyright 2005-08 www.BigResource.com, All rights reserved