OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 15-01-2004, 09:40
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default Calendar Date Selection

I am creating a form in VBA that with ask the user for various inputs that will be dumped to a form and printed out automatically. The question I have is:
When the user gets to the "Date order came in:" box and "Due Date:" box I want to use some sort of visual calendar for them to choose the date from (2 instances). Is there an easy way to do this?

I was orignally thinking of using a multi column listbox to populate the calendar, but I'm not sure how to get the months, days, and years to increment. I only want one month per list box, kinda like you get when you double click your time stamp in the task tray in windows.

I see a lot of programming this thing in my future.

Sean
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #2  
Old 15-01-2004, 10:07
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Calendar Date Selection

Sean,

Good part about VBA is that you can use ActiveX controls on its forms. You can use the controls which are already installed on your system (provided you have a proper license for using them, if applicable), or you can buy or download controls online and use them in your projects.

I just looked at the installed controls on my machine and saw at least two different calendar selection controls. One which apparently came with MS Access and one which is a part of OS standard common control set.

See the attached an image of the two controls in a sample VBA form.

To add the custom controls to your projects, do the following:
  1. Create a new or open an existing VBA form
  2. You should see a toolbox palette with the available controls such as buttons, text boxes, etc
  3. Right click the toolbox
  4. Select "Additional Controls..." from the popup meny
  5. You will see a list of available ActiveX controls on your system
  6. I chose "Calendar Control 8.0" which came from "D:\WinNT\System32\MSCAL.OCX" on my machine. That's the MS Access control
  7. I also selected "Microsoft Date and Time Picker Control 6.0" which is from "D:\WinNT\System32\mscomct2.ocx"
  8. Place the checkmarks for the controls you want to add and click OK
Now you should see the new controls in the toolbox. Put them on the form and use as you see fit.

Note that you may or may not have the above mentioned controls on your machine.

If you can't find what you need, just browse the internet. Sites such as:

http://www.activexcontrol.com/gui.htm
http://www.activex.com/
http://www.vbxtras.com/
http://www.active-x.com/
http://www.activexcatalog.com/

... and many more should have you covered.

I hope this helps.
Attached Images
 
Reply With Quote
  #3  
Old 15-01-2004, 10:29
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

I am using XP Pro formatted NTFS. Will that work? I noticed you are on NT.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #4  
Old 15-01-2004, 11:08
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Quote:
Originally Posted by ddonnahoe
I am using XP Pro formatted NTFS. Will that work? I noticed you are on NT.
It doesn't matter what file system you run. When an ActiveX control is installed it will get registered on the system so that VBA and other tools could find it. I just specified the file names just to give you an idea where those controls are installed on my machine and what the OCX file names are so that you can identify if your control is exactly the same as mine.

However normally you do not care about where the control is installed and how its file named. One thing to note though is that some commercial applications install their own controls which are registered on the system and even though VBA can see them you may have no legal rights to use it in your own applications, even less so to distribute them with your application.

Distributing ActiveX controls with you application is another issue for macros. You cannot assume that every user has the control installed even though you had it on your machine. So, when sharing your macros which use custom controls, you should provide a way for the users to install the custom controls you've used, otherwise they won't be able to run your solution.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED HELP ON CORELDRAW SCRIPT. FREE PHOTO CALENDAR IF U CAN! johnlfitz CorelDRAW/Corel DESIGNER VBA 8 06-06-2008 23:59
Date Picker Tweak ddonnahoe CorelDRAW/Corel DESIGNER VBA 2 29-10-2004 11:02
Calendar Wizard 4.1 is released! Alex Calendar Wizard 2 24-02-2004 10:49
Can I hange month start date on yearly single page calendar kingfish Calendar Wizard 2 22-02-2004 21:56
Calendar Wizard 4.0 is released! Alex Calendar Wizard 2 18-11-2003 09:58


All times are GMT -5. The time now is 04:19.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com