[AccessD] Trouble using Split command

Kaup, Chester Chester_Kaup at kindermorgan.com
Fri Apr 22 10:50:18 CDT 2011


The (0) is to put the first element of the array into the variable Test

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Friday, April 22, 2011 10:12 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Trouble using Split command

What is the (0) for?  You have to declare the variable as a variant
because the value returned from Split is an array.

Charlotte Foust

On Fri, Apr 22, 2011 at 7:57 AM, philippe pons <phpons at gmail.com> wrote:
> Dim Test() As Variant
>
> Philippe
>
> 2011/4/22 Kaup, Chester <Chester_Kaup at kindermorgan.com>
>
>> I am trying to use the split command on the following string
>>
>> "                                0.000            243.729             -
>>   61.495              -"
>>
>> I have a dim statements as follows
>> Dim LineText As String
>> Dim Test() As String
>>
>> The split statement is as follows
>> Test = Split(LineText)(0)
>>
>> No matter how I dim Test() I get an error message of
>> Run Time Error 13
>> Type Mismatch
>>
>> This seems like it should be real simple but I am obviously missing
>> something.
>>
>> Thanks.
>>
>>
>>
>>
>> Chester Kaup
>> Engineering Technician
>> Kinder Morgan CO2 Company, LLP
>> Office (432) 688-3797
>> FAX (432) 688-3799
>>
>>
>> No trees were killed in the sending of this message. However a large number
>> of electrons were terribly inconvenienced.
>>
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list