View Single Post
  #2 (permalink)  
Old May 21st, 2007, 07:59 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure I see the difference between this code:

Function doRequest(serverName, topic, request) As Variant()
Dim chan As Integer
chan = Application.DDEInitiate(serverName, topic)
doRequest = Application.DDERequest(chan, request)
Application.DDETerminate chan
End Function

and this code:

Function doRequest(serverName, topic, request) As Variant
Dim chan As Integer
chan = Application.DDEInitiate(serverName, topic)
doRequest = Application.DDERequest(chan, request)
Application.DDETerminate chan
End Function

Be that as it may, Access wants you to Dim the array, like this:

Dim MyArray(i)

Where i is some known value. You could do this by either counting the value before you dim the array, or, normally what I will do is this sort of thing, which won't work for you, but you see how it wants to work:

i = 1
Do Until [some condition]
   ReDim Preserve MyArray(i)
   Add some value
   i = i + 1
Loop

Did that help any?




mmcdonal
Reply With Quote