Date Format Problem

A

Andy H

Hi,

I've been given the task of creating a custom form in Outlook 2000. The
form uses the 'Task' template and is required to set the due date
according to the priority selected and the time of day. This I have
successfully done in Outlook's version of VBA but I am having trouble
with the date format displayed.

I am in the UK and therefore want the date format to be along the lines
of dd/mm/yyyy. My PC (and perhaps more importantly those of my
colleagues who will be using the form) are all set correctly in the
region settings, and if you set the date to display on loading the form
using 'date' then it does indeed display correctly. The problem arrises
when you set the date from within the VBA, using "xxxx.value = date()+1"
works but puts enters the date in the American format mm/dd/yyyy which
results in an error message being displayed when you try to send the
form as Outlook correctly detects that it is in an invalid format. Is
there any way I can over-ride the format within the VBA code? Or is
there a simpler solution I have overlooked?

Any help would be greatly appreciated.

Thanks.
 
A

Ashutosh Varshney

Outlook should pick up the default date format from the
system. Instead of Date + 1 try the DateAdd function. If
that does not work try to set the date in its proper
format. (I think FormatDateTime())

HTH

- AV
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top