Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining Month as Integer from Date 1

Status
Not open for further replies.

ShannonSkipper

Technical User
Sep 9, 2004
23
US
When I put a Date in a field called sDate I want a field called StartMonth to automatically set its value to the coresponding Month as an Integer. So if the sDate value is 9/12/1999 I need the StartDate value to be set to 9. Should I use an "on lost focus" event procedure? Any ideas?

Thanks much for your help,
Shannon
 
Since you shouldn't store a calculated field/a field that can be derived from another field, I'd say just use a controlsource of =Month([sDate]).

Roy-Vidar
 
ShannonSkipper . . . . .

In the [blue]AfterUpdate Event[/blue] of [blue]sDate[/blue] try this:
Code:
[blue]Me!StartMonth= Month(Me!sDate)[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top