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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Dates in combo boxes

Status
Not open for further replies.

splint1906

Technical User
Jul 19, 2004
27
US
I have a form where the user choose the Starting MMM-YYYY and Ending MMM-YYYY. I'd like to set the default value for the Starting Period and the Ending Period to Jan-Present Year and Dec-Present Year.

I've tried to use the following code on the OnOpen event procedure of the form but I think my syntax is wrong:

Me.Starting_Period.Defaultvalue = "Jan-" &Year(Now())
 
change your code to

Me.Starting_Period = "Jan-" &Year(Now())

but if you want it as the default value set this in the properties on the control, not when you are trying to open up the form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top