vb.net with Access - to click datetimepicker and will show dates

to click datetimepicker and will show dates in the textbox

Page 1 of 1

7 Replies - 4566 Views - Last Post: 09 February 2010 - 05:23 PM Rate Topic: -----

#1 Needanswer  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 61
  • Joined: 27-January 10

vb.net with Access - to click datetimepicker and will show dates

Posted 08 February 2010 - 01:47 AM

1.I want to click the datetimepicker and textbox will display dates by dates,I want to know if I can do this. Example - textbox will display -> 2/10/2010,2/12/2010,2/25/2010.

2. Can I off the today default on the datetimepicker?


THANKS.

This post has been edited by Needanswer: 08 February 2010 - 01:50 AM

Is This A Good Question/Topic? 0
  • +

Replies To: vb.net with Access - to click datetimepicker and will show dates

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: vb.net with Access - to click datetimepicker and will show dates

Posted 08 February 2010 - 06:47 AM

Not sure I fully understand the question but You can add days to a date

today.addDays(5)


Being that today is the 8th, this would give a result of 2/13/2010

Can you show us an example of what exactly you're trying to achieve?

This post has been edited by CharlieMay: 08 February 2010 - 06:51 AM

Was This Post Helpful? 0
  • +
  • -

#3 Needanswer  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 61
  • Joined: 27-January 10

Re: vb.net with Access - to click datetimepicker and will show dates

Posted 08 February 2010 - 07:50 PM

TextBox9.Text = TextBox9.Text.Substring(0, TextBox1.TextLength - 2) & "."



Put this before the INSERT.

  Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged

        If Len(DateTimePicker1.Value.Date) = 0 Then
            TextBox9.Text = DateTimePicker1.Value.Date
        Else
            TextBox9.Text = TextBox9.Text + DateTimePicker1.Value.Date + ", "
        End If




For this program, I can get the date on the textbox = 2/10/2010,2/25/2010.

I HAVE A QUESTION - I HAVE TO SAVE THE DATES TO THE ACCESS FROM THE DATAGRIDVIEW,ACTUALLY,WHEN I CLICK THE SAVE BUTTON, TODAY'S DATE WILL DISPLAY ON THE TEXTBOX(I DID NOT CLICK IT IN), BUT IT WON'T SHOW UP ON THE DATAGRIDVIEW, AND ON THE ACCESS DATABASE, ACTUALLY,THIS IS WHAT I WANT. BUT MY QUESTION IS, CAN I SWITCH OFF THE DEFAULT FOR TODAY - DateTimePicker, OR IF I DON'T, IT WILL HURT MY PROJECT - BUGS????

THANKS.
Was This Post Helpful? 0
  • +
  • -

#4 Needanswer  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 61
  • Joined: 27-January 10

Re: vb.net with Access - to click datetimepicker and will show dates

Posted 08 February 2010 - 08:45 PM

 Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged

 If Len(DateTimePicker1.Value.Date) = 0 Then
            TextBox9.Text = DateTimePicker1.Value.Date
        Else
            TextBox9.Text = TextBox9.Text + DateTimePicker1.Value.Date + ", "
        End If




This is for date and date- 2/10/2010,2/12/2010,2/25/2010,. HOW ABOUT IF I WANT TO DO- 2/10/2010-3/1/2010??


THANKS.

This post has been edited by JackOfAllTrades: 09 February 2010 - 06:06 AM

Was This Post Helpful? 0
  • +
  • -

#5 krismania  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 18
  • View blog
  • Posts: 148
  • Joined: 03-January 10

Re: vb.net with Access - to click datetimepicker and will show dates

Posted 08 February 2010 - 10:57 PM

Ime kind of confused by your question :sleepy:
could you try to explain it some more?
Was This Post Helpful? 0
  • +
  • -

#6 Needanswer  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 61
  • Joined: 27-January 10

Re: vb.net with Access - to click datetimepicker and will show dates

Posted 09 February 2010 - 01:24 AM

My question is - if I can do this 2/15/2010-3/10/2010 on the textbox, when after click the datetimepicker.

THANKS.
Was This Post Helpful? 0
  • +
  • -

#7 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: vb.net with Access - to click datetimepicker and will show dates

Posted 09 February 2010 - 06:29 AM

OK, your questions are very hard to follow. So I'll take a stab at it based on your previous question of building the string.

It seems you want to be able to select a date and it add it to the textbox, then select another date from the same datetimepicker and it appends it to the textbox separated by a comma.

In the ValueChanged event you could use the following:
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged
        TextBox1.Text &= DateTimePicker1.Value & ","
    End Sub

Was This Post Helpful? 0
  • +
  • -

#8 Needanswer  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 61
  • Joined: 27-January 10

Re: vb.net with Access - to click datetimepicker and will show dates

Posted 09 February 2010 - 05:23 PM

Actually, I want to be able to select a date (example, 2/10/2010-) and it add it to the textbox, then select another date(example,3/28/2010) from the same datetimepicker and it appends it to the textbox.(It will be like this, 2/10/2010-3/28/2010). POSSIBLE???? THANKS.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1