Link to home
Start Free TrialLog in
Avatar of sirbounty
sirbountyFlag for United States of America

asked on

Help with my array...

I seem to get hung up on arrays...

First of all, I have a label, when clicked, shows a date control (vbmodal).
Once the date is chosen, I want the month, day & year seperated.

In my click event, I currently have
        Dim intTemp() As Integer
        frmDate.Show vbModal
        ReDim intTemp(UBound(Split(dateClick, "/")))

Now, I have the 3 elements in my intTemp array, but I can't assign anything to them the way I would like.

Btw, I know the 'easy' answer is "declare intTemp as a variant", but I don't really want to go that route if unnecessary...
ASKER CERTIFIED SOLUTION
Avatar of bkthompson2112
bkthompson2112

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Tomlinson
The answer you don't want:

    Dim intTemp As Variant
    frmDate.Show vbModal
    intTemp = Split(dateClick, "/"))
    Debug.Print "Month = " & intTemp(0)
    Debug.Print "Day = " & intTemp(1)
    Debug.Print "Year = " & intTemp(2)

If you really want an array of Integer then:

    Dim intTemp(2) As Integer
    Dim strTemp As Variant
    frmDate.Show vbModal
    strTemp = Split(dateClick, "/"))
    intTemp(0) = CInt(strTemp(0))
    intTemp(1) = CInt(strTemp(1))
    intTemp(2) = CInt(strTemp(2))

~IM
Avatar of sirbounty

ASKER

Great - now can I get some help on this far stranger problem?
http:Q_21165122.html
Avatar of bkthompson2112
bkthompson2112

Thanks :)