473,395 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Further Day of Week Program

Help Can you help with this question:

Use the Weekday() function to return day of week as number 1=Sunday 2 = Monday etc. There are two text-boxes seperated by a command button"Day of week". I've entered aforementioned code:
Select Case WeekDay (txtDate.Text)
Case1
txtDayOfWeek.Text ="Sunday"
Case2
txtDayOfWeek.Text ="Monday"

Case3
Etc
Etc
Etc

End Select
I've tried this but can't get it to work. Where does the code go ? Is it in the validate( ) function on the second part of the first text box. What do you click? The command button or the text box? Help I'm hopelessly confused. What is it trying to do in any case...........?
N Lawton
Jan 24 '07 #1
4 1211
willakawill
1,646 1GB
Help Can you help with this question:

Use the Weekday() function to return day of week as number 1=Sunday 2 = Monday etc. There are two text-boxes seperated by a command button"Day of week". I've entered aforementioned code:
Select Case WeekDay (txtDate.Text)
Case1
txtDayOfWeek.Text ="Sunday"
Case2
txtDayOfWeek.Text ="Monday"

Case3
Etc
Etc
Etc

End Select
I've tried this but can't get it to work. Where does the code go ? Is it in the validate( ) function on the second part of the first text box. What do you click? The command button or the text box? Help I'm hopelessly confused. What is it trying to do in any case...........?
N Lawton
Hi. You should put this code in the onclick event of the button. there is not enough code here for me to determine why it is not working.
Jan 24 '07 #2
Killer42
8,435 Expert 8TB
My guess would be that you are invoking the Weekday() function with a string, rather than a date. However, I could be wrong - in some circumstances VB will do the type conversion for you. Anyway, try this...
Expand|Select|Wrap|Line Numbers
  1. Select Case WeekDay (CDate(txtDate.Text))
Jan 25 '07 #3
thank you for your help. I was really confused...................
Jan 25 '07 #4
Killer42
8,435 Expert 8TB
thank you for your help. I was really confused...................
Have you tried it yet? I can't guarantee that's your problem, it just seemed like something worth checking.
Jan 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Matt | last post by:
My ASP page allows the user select the date, and it will display the report during that week of that date. My question is when the program query database, I need to know the beginning date and...
7
by: Shuffs | last post by:
Could someone, anyone please tell me what I need to amend, to get this function to take Sunday as the first day of the week? I amended the Weekday parts to vbSunday (in my code, not the code...
9
by: Ray | last post by:
I need to convert the normal calendar to show the week no., the period no. and the financial year. The financial year format is as follows:- Date start: 2 May, 2005 7 days a week, 4 weeks a...
3
by: Steph. | last post by:
Hi, When I use the "Calendar.GetWeekOfYear" function (with "fr-BE" as CultureInfo and Monday as the first day of week) I get : Friday 31/12/2004 : week = 53
3
by: sbaird | last post by:
Aloha from Hawaii, I'm beating my head on the wall here. I have a recruiting contact managment database I'm trying to create. Managers (there ar 14 of them) have to make a certain number of...
2
by: tasmontique | last post by:
I am working on an access 2002 flight schedule database. I am new to access but have some basic understanding of sql and vb6 code. I have learned a lot from this website. Thanks much Hopefully...
0
by: JosAH | last post by:
Greetings, This tip of the week introduces a bit of theory when it comes to Object Oriented programming. First we indroduce a little example project: a simple geometry project. We want to define...
5
by: Aljosa Mohorovic | last post by:
i use this to find out current week and total number of weeks for current year: now = datetime.now() weeks_in_year = int(date(now.year, 12, 31).strftime("%W")) current_week = int(date(now.year,...
3
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, is there a way if you are given a Year and a Week an easy way to go back say 26 weeks ago from given year/week. for example, given: 2008/16 26 weeks prior is: 2007/43 thanks,
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.