If I format the control as Short Date it defaults to 12/30/1899. It doesn't matter what date I input the default shows as 12/30/1899?
If I format the control as General Date it defaults to 12:00:43.
If I do the following it still shows as 12/30/1899
CurrentFieldValue = Forms!frmYourForm!txtYourControl
Forms!frmYourForm!txtYourControl.DefaultValue = format(CurrentFieldValue,"mm/dd/yyyy"
try applying the CVDate (convert to date) function to the user supplied control's value; ie:
CurrentFieldValue = CVDate(Forms!frmYourForm!txtYourControl). Its currently converting the results of 1 divided by 1 divided by 2004 to a datetime; hense the funny results.
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
...Steve is correct, but better yet, convert the form variable to a date datatype so you won't have to concern yourself with altering stuff back and forth all the time.
Jim
Don't be sexist - Broads hate that.
Another free Access forum:
Quite right Jim .... I had assumed that the form's control was unbound, but looking at the greater context of the thread it is bound; hense the field type should be date.
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.