Link to home
Start Free TrialLog in
Avatar of Sandra Smith
Sandra SmithFlag for United States of America

asked on

Set date control when form opens

I have an Access 2003 form that when it opens, I want the text control, txtDate, to simply be the date of the End of the MOnth for the prior month.  However, whenever I try to pass in today date via the Date function, it keeps error indicating it is a null value.  Can a text field be initialized to a date usign the form open event?  

Sandra
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For example ...

DateSerial(Year(Date()),Month(Date()),0)
Returns 04-30-2012
Avatar of Sandra Smith

ASKER

Thank you.  I simply never think of the DateSerial and it always seems to solve my issues.

Sandra