Solved

Outlook Forms, I need a Date & Time Picker!!!

Posted on 2006-11-27
21
822 Views
Last Modified: 2008-01-09
Hi guys

This is a two part question.

Firstly iam using outlook 2007.

Now i want to create a new form to schedule jobs, works exactly the same way as a new appointment except with a few extra fields.

Now when i select start and end to put on the new form (P.2), it comes up as a text box, not a drop down to a calander like it should.

Ive had a read around seems its a limitation with outlook, but iam pretty sure they came around it with the 2007 outlook? not sure where i read it.

Anyway, whats the easiest way to get.

1. The calander exactly like the appointment form
2. And the time drop down box exactly like the appointment form.

You help is really appreciated if u can show me how to do this!

0
Comment
Question by:swiftlink
  • 12
  • 7
21 Comments
 
LVL 8

Expert Comment

by:RickJ
ID: 18024341
I dont use 2007, but have 2003.
The Date Time Picker is not a standard control on the toolbox.
To add it, I right clicked on the toolbox, click on custom controls, then added the Microsoft Date Time Picker.
It is then available to drop onto the form and customize.

Hope this helps.
0
 

Author Comment

by:swiftlink
ID: 18024379
it does, ive got that microsoft one on like you said.

I customerized it to look just like the text box. I ran it, and it puts a new appointment on the date i said.

How do u do time drop down box as date is useless without it?

0
 

Author Comment

by:swiftlink
ID: 18024385
also when i double click on the new apppointment form in the calender, it says

To help prevent malicious code from running, one of more objects in this form were not loaded, for more information, contact your administrator.

Any ideas how to allow it??? obvously it doesnt like it.
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:swiftlink
ID: 18024402
great i got the time one working

what i did was make a drop down box, incuded all the time values, and it works =D

just need to allow the error to be resolved.
0
 
LVL 8

Expert Comment

by:RickJ
ID: 18024442
Just add a combobox and add in your time values.
0
 
LVL 8

Expert Comment

by:RickJ
ID: 18024474
Sorry didnt see your last post :)...
This solution fixed the same issue for me...

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21200387.html
0
 

Author Comment

by:swiftlink
ID: 18025381
thanks for that link, it fixed the issue.

I was testing it again before, and looks like the date doesnt fuction properly.

I set the date for tomorrow, and it always shows up today?

the time works fine though.

The date box has these fields

Choose Field: Start
Type: Date/Time
Format: Tuesday, 28th November 2006 3:30 PM
Property to Use: Value
0
 

Author Comment

by:swiftlink
ID: 18025416
After extensive Testing i found these problems. Keep in mind my layout is just like the appointment form.

1. When clicking on the start date, i select a date, the end date does nto change unless i click on something else.

2. After i set the date and click on the drop down box for the time the date resets back to today. (probably why i cant make an appointment in the future unless i dont touch the time box.
0
 

Author Comment

by:swiftlink
ID: 18025866
how is yours workig, what do u use it for?
0
 

Author Comment

by:swiftlink
ID: 18025904
*working
0
 

Author Comment

by:swiftlink
ID: 18032937
from what i can see, something about having two boxes, both using the end field, is not dynamic.

Should both the date and time box use end as the field or something else.

0
 
LVL 8

Expert Comment

by:RickJ
ID: 18033712
Hello swiftlink.
Sorry for the delayed response. I got busy.
Maybe if you tell me exactly what you want your form to do, I will then be able to give the best instructions.
0
 

Author Comment

by:swiftlink
ID: 18033763
Hi rick

well the form is to create a job request from my customers.

It looks similar to the normal appointment form, excpet with fields such as problem description, resolution etc.

This is so i can keep track of every customer, and jobs i have done for them.

0
 

Author Comment

by:swiftlink
ID: 18033971
This is what i did

When into design new form using appointment.

Added microsoft date & time picker to the control list.

Added the 1st picker, using start field.

Choose Field: Start
Type: Date/Time
Format: Tuesday, 28th November 2006 3:30 PM
Property to Use: Value

Same went for end date

Choose Field: End
Type: Date/Time
Format: Tuesday, 28th November 2006 3:30 PM
Property to Use: Value

Then created a combo box, with time values.

Also tried a picker as well using these details

Choose Field: Start
Type: Date/Time
Format: 3:30 PM
Property to Use: Value

And still either box will overrides the value of the other one.

ie, when i click on start date, choose a date, then click on start time, choose a time.

The time value will override the date i just choose.
0
 
LVL 8

Expert Comment

by:RickJ
ID: 18111827
Hello swiftlink,
Sorry again for the delay.
How did you go with this?
What you need to do in this situation is not set the property to anything.
You will need to put some code behind these to set the end or start by adding the value of the two datepickers together.
Make sense??
0
 

Author Comment

by:swiftlink
ID: 18150351
i do get you, any chance u know the code??
0
 
LVL 8

Expert Comment

by:RickJ
ID: 18156707
Yes, try this

Add a datetimepicker to your form.
Add a combobox to your form.

Then click on the Form menu, View Code
Then paste this (This will do the start, add another datetimpicker + combo for the end)

Function Item_Write()
  Set objPage = _
      Item.GetInspector.ModifiedFormPages("P.2")
  Set objControl1 = objPage.Controls("DTPicker1")
  Set objControl2 = objPage.Controls("ComboBox1")

   With Item
    .Start = objControl1.Value + CDate(objControl2.Value)  
  End With

End Function
   
Function Item_Open()
  Set objPage = _
      Item.GetInspector.ModifiedFormPages("P.2")
  Set objControl3 = objPage.Controls("ComboBox1")
 
  objControl3.AddItem "12:00 AM"
  objControl3.AddItem "12:30 AM"
  objControl3.AddItem "1:00 AM"

End Function
0
 

Author Comment

by:swiftlink
ID: 18156851
Thank you so much, that worked.

So what is the go to create the end time and date?

0
 
LVL 8

Accepted Solution

by:
RickJ earned 500 total points
ID: 18157159
You would just add another Datepicker and combo to the form for the end time.
Then your code would look something like this...

Function Item_Write()
Set objPage = _
Item.GetInspector.ModifiedFormPages("P.2")
Set objControl1 = objPage.Controls("DTPicker1")
Set objControl2 = objPage.Controls("ComboBox1")
Set objControl5 = objPage.Controls("DTPicker2")
Set objControl6 = objPage.Controls("ComboBox2")


With Item
.Start = objControl1.Value + CDate(objControl2.Value)
.End = objControl5.Value + CDate(objControl6.Value)
End With

End Function

Function Item_Open()
Set objPage = _
Item.GetInspector.ModifiedFormPages("P.2")
Set objControl3 = objPage.Controls("ComboBox1")
Set objControl4 = objPage.Controls("ComboBox2")


objControl3.AddItem "12:00 AM"
objControl3.AddItem "12:30 AM"
objControl3.AddItem "1:00 AM"
objControl4.AddItem "12:00 AM"
objControl4.AddItem "12:30 AM"
objControl4.AddItem "1:00 AM"


End Function
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question