Hi, was wondering if anybody could offer me some help please. On a form I have a textbox and 2 labels. I want the labels to show a specific date, considering what the number is in the textbox.
The above is the first label which shows the current date in label 1. In label2 what I need is a date being calculated from the number in the textbox. For example if the number is between 1 and 3 then I want the date to be exactly 2weeks from label1, if the number is between 4 - 6 then I want the date to be 1 week from label1, and if the number in the textbox is 7+ then I want the date to be 3 days from label1 BUT is there any chance I can exclude weekends? For example if the date is Wednesday in label1, I want the second date to be Monday not Saturday. So far I have the following coding, but when running there are so many errors, could anyone help me out a little please.
VB.NET:
Dim datetod As Date
datetod = Date.Now.ToLongDateString
Label1.Text = datetod
The above is the first label which shows the current date in label 1. In label2 what I need is a date being calculated from the number in the textbox. For example if the number is between 1 and 3 then I want the date to be exactly 2weeks from label1, if the number is between 4 - 6 then I want the date to be 1 week from label1, and if the number in the textbox is 7+ then I want the date to be 3 days from label1 BUT is there any chance I can exclude weekends? For example if the date is Wednesday in label1, I want the second date to be Monday not Saturday. So far I have the following coding, but when running there are so many errors, could anyone help me out a little please.
VB.NET:
Dim datetod As Date
datetod = Date.Now
Select Case datetod.DayOfWeek
Case 0, 6
Messagebox.show "Please order on Monday"
Case Else 1,2
If textbox1.text = "0 - 3" Then
Label2.Text = datetod.AddDays(14).ToString
Else If textbox1.text = "4 - 6" Then
Label2.Text = datetod.AddDays(7).ToString
Else If textbox1.text = >7 Then
Label2.Text = datetod.AddDays(3).ToString
Case Else 3
If textbox1.text = "0 - 3" Then
Label2.Text = datetod.AddDays(14).ToString
Else If textbox1.text = "4 - 6" Then
Label2.Text = datetod.AddDays(7).ToString
Else If textbox1.text = >7 Then
Label2.Text = datetod.AddDays(5).ToString
Case Else 4
If textbox1.text = "0 - 3" Then
Label2.Text = datetod.AddDays(14).ToString
Else If textbox1.text = "4 - 6" Then
Label2.Text = datetod.AddDays(7).ToString
Else If textbox1.text = >7 Then
Label2.Text = datetod.AddDays(4).ToString
Case Else 5
If textbox1.text = "0 - 3" Then
Label2.Text = datetod.AddDays(14).ToString
Else If textbox1.text = "4 - 6" Then
Label2.Text = datetod.AddDays(7).ToString
Else If textbox1.text = >7 Then
Label2.Text = datetod.AddDays(3).ToString
End Select