|
-
Oct 9th, 2000, 08:37 PM
#1
Thread Starter
Lively Member
I have declared my fixed array in a module.bas file
but when i try to run it i get an error "subscript out of
range"
run time error "9"
any ideas what im doing wrong???
Code:
Option Explicit
Public outSkillsData()
then tried using my array called outskillsdata
Code:
Dim noData As Boolean
noData = False
On Local Error Resume Next
If UBound(outSkillsData, 2) = 0 Then noData = True
On Local Error GoTo 0
help me what am i doing wrong?????
-
Oct 9th, 2000, 09:17 PM
#2
Your Error with Arrays
Hi JohnnyBoy
The problem is that the array is not declared correctly. If it is a fixed array it needs to have the length inside the brackets ie,
Public outSkillsData(10)
What you have done is declare a dynamic array. Using this technique you need to redim the array befor you use it, ie
ReDim outSkillsData(10)
Regards Robert
-
Oct 9th, 2000, 09:35 PM
#3
Thread Starter
Lively Member
robdehn
oops you are right it is a dynamic array
i have tried to redim the array but still come
up with that error???
any ideas on that one?????
-
Oct 9th, 2000, 09:39 PM
#4
robdehn's reply
When do you get the error?
I can both read and write to the redimed array!
-
Oct 9th, 2000, 09:50 PM
#5
Thread Starter
Lively Member
here it is i redimed it but the error occured at the same place?????
Code:
Function popEditSkills(theForm As Form) As Integer
'****************************************************************
' Populate the skills part of the form with the valid skills
' from the database
Dim i As Integer
Dim j As Integer
Dim theindex As Integer
Dim tempDyna As Recordset
Dim noData As Boolean
ReDim outSkillsData(10)
noData = False
On Local Error Resume Next
If UBound(outSkillsData, 2) = 0 Then noData = True
On Local Error GoTo 0
If noData Then
'if outSkillsData is empty then this routine will fill the array from the database
'and pop the outline at the same time
With theForm.outSkills
.Clear
.AddItem "Technical"
-
Oct 10th, 2000, 02:47 AM
#6
Lively Member
Try this and see if it works:
Dim outSkillsData() As String
0101011001000010
01101111011011100110110001101001011011100110010101110010
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|