
Putting together a date...
Quote:
> > Now if I ask the user in my program to input a date, a month and a
> > year, how do I put those three together to make a legal and accurate
> > Date variable?
> Use the CDate() function. Ex:
> MyDate = CDate(USMonth & "/" & USDay & "/" & USYear)
> Note though that that is locale aware, so you might end up with days and
months
> swapped when working with the United States and Europe or something.
A "safer" way might be to do something along the lines of:
myDate = DateAdd("yyyy", myYear - 1900, myDate)
myDate = DateAdd("m", myMonth - 1, myDate)
myDate = DateAdd("d", myDay + 1, myDate)
This shouldn't matter which format your dates are set to in Windows.
Rob.