Wrox Programmer Forums
|
Forum and Wrox.com Feedback Post your suggestions for improving the Forums or Wrox.com or questions for the staff here. "Where can I find the code for my book?"
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Forum and Wrox.com Feedback section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 28th, 2012, 12:17 PM
Registered User
 
Join Date: Aug 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with end of month

Hi,
When the user chooses the end of month as date from DateTimePicker,
The months should be incremented correctely.

For example, if one has date 31/12/2012, he should receive:
31/01/2012, 29/02/2012, 31/03/2012, and so on.

But with the code below, the date doesn’t move from the day 29:
31/01/2012, 29/02/2012/, 29/03/2012, 29/04/2012,...

Any help would be appreciated with great many thanks.

This is the code:

Dim dtN As Date = DateTimePicker.Value.ToShortDateString
Dim i as integer
For i = 1 To Periods
dtN = dtN.AddMonths(1)
dgvAmortis.Rows.Add()
dgvAmortis.Item("datecol", i - 1).Value = Format(dtN, "dd/MM/yyyy").ToString





Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting month name to month number kalyanykk SQL Server 2005 7 August 19th, 2008 10:37 PM
Oracle back-end MS-Access 2003 client front-end Corey Access 2 February 16th, 2007 08:31 AM
Oracle Back End - MS Access Front End - Multi User ckaliveas Oracle 1 February 1st, 2007 06:00 AM
query Current Month, Month+1, Month+2, Month+3 anterior Access 2 September 24th, 2006 08:25 PM
How to check end of month CMensah Access 4 August 22nd, 2005 09:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.