Hi
I have a userform on which there are a number of comboboxes, one for Day of
week, one for date, one for Month and one for Year. On initialising the
dialog, I am looking to populate each combobox with the day and date 14 days
from opening the document, i.e 14 days drom today.
The problem I have is I can sort out the date, Month and Year, however, I'm
having difficulty with the Day of the Week, i.e Monday, Tuesday etc.
I've attached sample of my code so far and would be grateful for any
assistance
Dim x As Integer
Dim MyDate, MyDay, MyMonth, MyYear
Dim ReqDate
Dim IntervalType
IntervalType = "d"
'Sets up values to be visible in form objects
MyDate = Format(Date, "dd MMMM yyyy") ' Assign a date.
ReqDate = DateAdd(IntervalType, 14, MyDate)
MyDay = Day(ReqDate)
MyYear = Year(ReqDate)
MyMonth = Month(ReqDate)
Thanks
Al@n
Jay Freedman - 14 Sep 2005 21:57 GMT
Hi Alan,
MyDayOfWeek = Format(ReqDate, "dddd")
Have a look at the VBA help topic "User-Defined Date/Time Formats (Format
Function)".

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
> Hi
> I have a userform on which there are a number of comboboxes, one for
[quoted text clipped - 26 lines]
>
> Al@n
Al@n - 14 Sep 2005 22:16 GMT
Jay
Just what I was after......the word "format" was missing from my numerous
attempts.
Thanks for your help & advice
Regards
Al@n

Signature
Al@n W@tkins
alan@gawsi.freeserve.co.uk
> Hi Alan,
>
[quoted text clipped - 33 lines]
>>
>> Al@n