Number of Day.

W

Willie

I have two text boxes. TxtBox1 and txtBox2. TxtBox1 is
set the default to the current Month, Year and the last
date of the month. On txtBox2, I would like it to be set
default to the numbers of date in according to txtBox1.
Examples : txtbox1= Jan/31/2004 then txtbox2 = 31.

What function should I us for the txtBox2?
Any help would be very appreciated.
 
B

Bruce M. Thompson

I have two text boxes. TxtBox1 and txtBox2. TxtBox1 is
set the default to the current Month, Year and the last
date of the month. On txtBox2, I would like it to be set
default to the numbers of date in according to txtBox1.
Examples : txtbox1= Jan/31/2004 then txtbox2 = 31.

What function should I us for the txtBox2?
Any help would be very appreciated.

Try the following in the "Control Source" property for txtbox2:

=Format([txtbox1], "y")
 
D

Douglas J. Steele

That may be a bad example. Do you want txtbox2 to be set to 31 because it's
the 31st of January, or because it's the 31st day of the year?

What if txtbox1 = Feb/29/2004. Should txtbox2 be 29 or 60?

For 29, the control source should be either =Date([txtbox1]) or
=DatePart("d", [txtbox1])

For 60, the control source should be =DatePart("y", [txtbox1])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top