Solved

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

Posted on 2006-11-27
21
833 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
outlook calendar 2 35
Outlook 2010 sends emails not originated by user 8 61
Automating an Excel Template using VBA and Outlook 8 25
exchange 2007, outlook 3 19
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

840 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