Link to home
Start Free TrialLog in
Avatar of morrisbo
morrisbo

asked on

Type mismatch error converting string to date variable in vb6

I'm getting a mismatch error when executing following code in vb6 program.

    dim sEffDate as string
    sEffDate = HO.IPINCPMMDDYYYY
    ' value of sEffDate is now 08012007
    Dim dEffDate As Date
    dEffDate = CDate(sEffDate)

' gives error message "Type mismatch"

Can anyone help a vb6 novice?
ASKER CERTIFIED SOLUTION
Avatar of PaulHews
PaulHews
Flag of Canada image

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 morrisbo
morrisbo

ASKER

PaulHews,

It works.

Thanks !!


Morris