View Single Post
  #3  
Old October 19th, 2009, 06:20 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Access 2003 - Setting default value of a text box

?dateserial(year(date),month(date)-1,1)
9/1/2009
?dateserial(year(date), month(date)+1,0)
10/31/2009
--
Dave Hargis, Microsoft Access MVP


"Amanda" wrote:

I have 2 text boxes in a form that default to two set dates. I'd like to
update the form so that txtStartDate is the first date of last month and
txtEndDate is the last date of this month. For example, if I were to pull
the form up today, I'd like txtStateDate's default to be 9/1/09 and
txtEndDate's default to be 10/31/09. If I pull it up the form in November,
txtStartDate should be 10/1/09 and txtEndDate is 11/31/09.

Both text boxes are unbound. Any suggestions?