Date entry in userform help

B

bmwmcrider

Hello,

I am trying to code a UserForm date entry technique using a TextBox
and a SpinButton but not having much luck at it. What I want to do is
have the date displayed in the text box as October 16, 2003. When I
hover over the month, it is hilighted and the spin button can be used
to select a new month. The same concept applies to the day and year
settings.

So my question is how is this done? I know that such a control exists
because is see done in Windows dialogs. In fact I have a couple apps
installed on my computer that popup dialogs and contain date setting
fields that do exactly as above.

I couldn't find anything on this subject in the couple Excel and VBA
books I have. Any help or suggestions would be appreciated. TIA ...

Mike
 
S

steve

You might want to check this out...
In Excel 2000 and higher there is a Calendar control on the Control Toolbar.
This shows a full calander.

Right click on the Controls Toolbox
Click Additional Tools
Select Calendar Control

Play with the Properties to get what you want.

(I haven't worked with this, yet)
 
B

bmwmcrider

Hi Steve,

Thanks for the reply. I am already familiar with the Calendar control;
there is also a MonthView control for entering a date.

However, both these controls take up a lot of space in the form. I am
trying to get a more compact control presentation for entering a date.
Thus, the TextBox control concept.

Mike




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Tom Ogilvy

You just put the code in the events of the spin buttons to increment the
value in the textbox. A special control for this function may exist, but
it is very straight forward using just a textbox and a spin button or three
textboxes and three spin buttons if you want to control month day and year
separately - you could have three spin buttons and a single textbox, but I
think that would be more confusing to the user.

If you want a sample workbook, send me an email with a valid email return
address.
 

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

Top