|
-
Apr 27th, 2005, 09:44 AM
#1
Thread Starter
New Member
DTPicker set to Null or Today in Outlook Task Form
Hi:
I'm a relative newbie and am trying to get the built-in DTPicker function to work in Outlook 2000/2003.
I have a control "DTPickerDueDate" on a Task form that is bound to the built-in "Due Date" field. I have set the control's "Property to use" as "Value." My DTPicker Properties are as follows: "Enabled" and "CheckBox"; Format = 1- dtpShortDate; MinDate and MaxDate are at their default values.
Ideally, I would like the default value of the DTPickerDueDate control to be null but I'm not sure if that's possible. If it can't be, I would like it to default to today's date. (I'm not sure how to do this - but I've read elsewhere that as long as the CheckBox is enabled - that it will default to today's date? If it must be done programatically, I would prefer to use VBscript so that I can distribute it with the form.)
If I select a date other than today's date, the Due Date field in Outlook gets updated appropriately. However, the only way I can get the Due Date field in Outlook to update appropriately is to use DTPicker to select a date other than today's date, and then change it back to today's date. Is there a way to choose today's date and have it update the Due Date field in Outlook?
Summary of questions:
1) How can one set DTPicker's initial value to null?
2) If 1) cannot be done, how do you set it to today?
3) How can you select today's date and have it update the bound field?
Thanks in advance for any help you might be able to give.
Dave
-
Apr 28th, 2005, 10:49 AM
#2
Re: DTPicker set to Null or Today in Outlook Task Form
I recently ran into something similar. If the user chooses a date at run-time, the appropriate Event fires, and you can get that chosen date out of the DTPicker control... However, as you noticed, this does not occur when you choose today's date.
I just read it out manually at Form_Load to work-around this problem.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Apr 28th, 2005, 11:00 AM
#3
Thread Starter
New Member
Re: DTPicker set to Null or Today in Outlook Task Form
Dave:
Thanks for the response. Being a virtual newbie to Outlook programming, can you please elaborate on what I need to do to "just read it out manually at Form_Load". I'm assuming I need some type of code behind the form. (If possible, I'd prefer VBscript versus VBA as it makes it easier for me to distribute to users.)
Thanks in advance for any direction you might be able to give.
Dave
-
Apr 28th, 2005, 11:01 AM
#4
Re: DTPicker set to Null or Today in Outlook Task Form
 Originally Posted by snsd
Dave:
Thanks for the response. Being a virtual newbie to Outlook programming, can you please elaborate on what I need to do to "just read it out manually at Form_Load". I'm assuming I need some type of code behind the form. (If possible, I'd prefer VBscript versus VBA as it makes it easier for me to distribute to users.)
Thanks in advance for any direction you might be able to give.
Dave
I don't use VBA for Outlook. I should have mentioned - I am using the actual Visual Basic 6 compiler, which by most accounts is quite simiilar to VBA.
Form_Load is the first thing that happens before all my code executes.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Apr 28th, 2005, 11:14 AM
#5
Thread Starter
New Member
Re: DTPicker set to Null or Today in Outlook Task Form
Thanks Dave. I wasn't sure if this was the right place to post such a question but I thought I'd give it a try as I'm having a challenge finding a good forum for Outlook VBA and VBscript. (I've found some excellent ones for Access.)
Anyhow, 2 questions:
1) Should I be asking about Outlook specific VBA or VBscript questions in this forum.
2) If "no" to 1), do you know of a good forum for Outlook programming?
Again, thanks in advance for your response.
Dave
-
Apr 28th, 2005, 11:15 AM
#6
Re: DTPicker set to Null or Today in Outlook Task Form
 Originally Posted by snsd
Thanks Dave. I wasn't sure if this was the right place to post such a question but I thought I'd give it a try as I'm having a challenge finding a good forum for Outlook VBA and VBscript. (I've found some excellent ones for Access.)
Anyhow, 2 questions:
1) Should I be asking about Outlook specific VBA or VBscript questions in this forum.
2) If "no" to 1), do you know of a good forum for Outlook programming?
Again, thanks in advance for your response.
Dave
Try the VBA forum on this site:
http://www.vbforums.com/forumdisplay.php?f=37
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Feb 7th, 2006, 09:29 AM
#7
New Member
Re: DTPicker set to Null or Today in Outlook Task Form
I think I can help some. I'm not sure how to set it to Null, but I think I can help you set it to today's date. In the properties window for your DTPicker control, the Value property is what sets the date. It normally defaults to the date that you create the control on the form. When I tried it, it wouldn't allow it to be blank. What I did was leave it as the default date (the date that the control was created), but I added code to the start-up script for the form. I think this is partly what Dave meant. You want to add code to the form load procedure so when the form loads it resets the value of the Value property for the DTPicker control. Here's an example of the code I inserted into the form's load procedure.
DTPickerControlName.Value = Format$(Now, "mm/dd/yyyy")
This resets the Value property to the current date when the form loads so that the DTPicker opens to the current date. "Now" is the code term that specifies today. I hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|