1. ## Due date monthly

Can help for this code

2. ## Re: Due date monthly

So what's the question? There's a screenshot... ok, great... I see a date in the Due date field... so....

I'm not sure what you've heard about the people here, but we are not mind readers. So we don't know what you're thinking, we only know waht you've told us, which isn't much at all. There's just a pictures and some words that seem like they should be a question but also written like a statement and nothing else.

-tg

3. ## Re: Due date monthly

Sorry about my question...i have written the code but not running.
i mean i want to know result in due date.
Example. I click today 01/05/2015 and i type in month " 2" and in due date have result 01/07/2015

-tg

5. ## Re: Due date monthly

i write the code like this

On Error Resume Next
TglJTDP.Value.Months = TglTransDP.Value.Months

If Val(TerminTxt.Text) + TglTransDP.Value.Month = 2 Then
TglJTDP.Value.Months = 2

ElseIf Val(TerminTxt.Text) + TglTransDP.Value.Month <= 12 Then
TglJTDP.Value.Month = TglTransDP.Value.Month + Val(TerminTxt.Text)

ElseIf Val(TerminTxt.Text) + TglTransDP.Value.Month > 12 Then
TglJTDP.Value.Month = (TglTransDP.Value.Month + Val(TerminTxt.Text)) Mod 12

TglJTDP.Value.Year = (TglJTDP.Value.Year + ((TglTransDP.Value.Month + Val(TerminTxt.Text)) + (12 - TglJTDP.Value.Month)) / 12) - 1

End If

but not working...can help me for this

6. ## Re: Due date monthly

Why can't not working

7. ## Re: Due date monthly

I gave you a link that will add months to your date... strangely enough, the method is called AddMonths. It's all you need. ONE line of code. ONE. No fancy calculations, just one line of code.

-tg

8. ## Re: Due date monthly

I do not understand your question

9. ## Re: Due date monthly

Originally Posted by techgnome
I gave you a link that will add months to your date... strangely enough, the method is called AddMonths. It's all you need. ONE line of code. ONE. No fancy calculations, just one line of code.

-tg
i write like this and working

Private Sub TerminTxt_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TerminTxt.TextChanged
Dim datenow As DateTime = DateAndTime.Now
TglTransDP.Value = datenow

End Sub

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Featured