Hi
assuming txtDate contains 19770127
datDate = CDate(Right(txtDate,2) & "/" & Mid(txtDate,5,2) & "/" & left(txtDate,4))
Should do it if you are confient txtDate always contains a valid date, other wise you might want to is the IsDate() Function to verify the date nefore converting it, eg
If IsDate(Right(txtDate,2) & "/" & Mid(txtDate,5,2) & "/" & left(txtDate,4)) Then
datDate = CDate(Right(txtDate,2) & "/" & Mid(txtDate,5,2) & "/" & left(txtDate,4))
Else
msgbox "Invalid Date"
End If
Ken Reay
Freelance Developer
kenneth.reay@talk21.com