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

How do I create a popup calendar?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to create a popup calendar that when you choose the date from it, it places it into a date filed on the main form.
 
You don't have to create it--there's an activeX calendar control that does what you want. Be aware of registry / reference problems if you move between '97 & 2000 platforms--it's one of those things, like Date(), that don't make the migration.
 
I've got that down. I know how to put the control on a form. I just want to make it so when I have a text box for a date, I can use a pop-up calendar and pick a date and have it show up in that text box
 
Here's a sketch of the solution w/out all the details:

Put a command button or label on the form with a caption that indicates "Calendar" somehow. In the click event open the calendar tool (I can't remember if it's default modal or not). If there's just one box that needs that date entered, rather than a multiple number of date boxes that could be the target, you can just use the Select/Click (I forget what's there) of the Calendar to send it's value to that box. This is pretty simple--I've done it but it's been tool long ago to remember the details.
 
I've done this recently and it's still pretty simple.
You can put a "select date" comand next to your SelectedDate textbox and change the ActiveXCtl visible property to True.

On the ActiveXCtl Click Event:
Code:
        SelectedDate() = ActiveXCtl16.Value
        SomeOtherField.SetFocus
        ActiveXCtl16.Visible = False
[\code]

You can add any 'If ... Then' tests to make sure no one is entering their work hours for next week instead of this week, etc.
 
Thank you both for your help. I was kinda close, but I got it now! Thanks again.
 
I created a calendar that does exactly what you want to do, as a regular form. You don't have to worry about using an ActiveX control, or dealing with registration problems on user's machines.

It is very simple to use and implement. I also like the navigation better than Microsofts calendar. If you are interested, let me know. Jim Lunde
compugeeks@hotmail.com
Custom Application Development
 
E-mail me, and I will send it to you. I can't post a database to the forum. Jim Lunde
compugeeks@hotmail.com
Custom Application Development
 
Jim Lunde, that's a beautiful thing!

Thank you very much,
BoxHead
 
Hi.

Late thought, I use this in heaps of places, just put the calendar on the double click event of the text box, pass the current contents (if a valid date) to the calendar, via a function, so it returns a date. Use activeX or a form. Both work.

We usually make the date text green and underlined, so that it looks like a hyperlink (so people think to double-click it)

Cheers.
Gzep.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top