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
Microsoft DevelopmentMicrosoft ApplicationsMicrosoft Access

Avatar of undefined
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
For example ...

DateSerial(Year(Date()),Month(Date()),0)
Returns 04-30-2012
Avatar of Sandra Smith
Sandra Smith
Flag of United States of America image

ASKER

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

Sandra
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo