Array problem

border20

Registered User.
Local time
Today, 13:54
Joined
Jan 8, 2003
Messages
92
Dim lines As Integer

lines= DCount("[field]", "[query name]")

Dim array(0 To lngNbLignes, 1 To 10) As String

I get a error at the declaration of the array....

anyone can tell me what i'm doing wrong ??

(btw the Dcount worked fine, i verified it)

thx
 
sorry i meant

Dim array(0 To lines, 1 To 10) As String
 
Search Help for 'Declaring Arrays' and 'Using Arrays' for more information on proper syntax..

Dim array(lines, 10) As String

I am unsure about the variable 'lines'...

Jack
 
Last edited:
Help files dont talk about using variables to declare arrays... :(
 
border20,

Dim lines As Integer
lines= DCount("[field]", "[query name]")
Dim array(0 To lngNbLignes, 1 To 10) As String


The arguments to the Dim statement must be constants!
I think your way around this is to use

Const lines As Integer = 20
Dim array(NewValue, 1 To 10) As String
NewValue= DCount("[field]", "[query name]")
ReDim Preserve array(NewValue, 10)

hth,
Wayne
 

Users who are viewing this thread

Back
Top Bottom