Ok what Im trying to do is create records in a loop.
What Im looking for is for the user to enter a start date and end date and have it enter the data into an sql database, increasing the date by a set number of days. Here is my code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim inputdate, lastdate As Date
inputdate = Me.startdate.Value
lastdate = Me.enddate.Value
Do While inputdate < lastdate
inputdate.AddDays(7)
MsgBox(inputdate)
Loop
End Sub
The problem Im running into is it just keeps outputing the orginal date selected, never actually adding 7 days, and staying within the loop.
The msgbox is just for debugging right now, I want to replace it with code to enter that data in the sql db. Any help would be appreciated
What Im looking for is for the user to enter a start date and end date and have it enter the data into an sql database, increasing the date by a set number of days. Here is my code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim inputdate, lastdate As Date
inputdate = Me.startdate.Value
lastdate = Me.enddate.Value
Do While inputdate < lastdate
inputdate.AddDays(7)
MsgBox(inputdate)
Loop
End Sub
The problem Im running into is it just keeps outputing the orginal date selected, never actually adding 7 days, and staying within the loop.
The msgbox is just for debugging right now, I want to replace it with code to enter that data in the sql db. Any help would be appreciated