Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2005

Tip: Looking for answers? Try searching our database.

Inserting Day of Week into Userform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Al@n - 14 Sep 2005 20:06 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.