On Sun, 6 Feb 2011 09:49:27 -0500, "Mike from Moriches"
<(E-Mail Removed)> wrote:
>?I have a form to collect the date range of a report. It contains a
>[startdate] control and an [enddate] control. I would like to default to a
>year to date (YTD) report. My default enddate is Date(). To create a
>startdate, I use the YEAR function to get the current year, then build the
>string #1/1/2011#. I want this as my default startdate. I have a module
>with a public function named YearStart(). The string variable I built is
>named DayOne. I set the default property of startdate to YearStart(DayOne).
>The control displays #Name? when I open the form. Can you tell me what I'm
>doing wrong, or if there is a better way to set the default to 1/1/yyyy?
>Thanks,
>Mike from Moriches
The simplest way would be to set the textbox's default value to
=DateSerial(Year(Date()), 1, 1)
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also
http://www.utteraccess.com