Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeat Record Insert based on Date

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
0
0
US
I'm putting together a very simple task/scheduler within one of our applications. So basically I need to be able to repeat record inserts based on which day of the week a user selects.

I have a date picker textbox that the user selects a date from the calendar.
There is a check box called "Repeat Every"

Then below that there are check boxes labeled Mon, Tues, Wed, Thur, Fri, Sat. and also a check box called "Until Date" with another Date Picker textbox

So, if the user chooses a Monday date from the date picker, and checks the box "repeat Every" and then check the box "Mon" I would need to insert records every monday until the last monday the user specifies in the "Until Date" date picker textbox.

I have no idea what the best approach would be to accomplish this.

Any help would be appreciated

Thanks

 

Use Date.Today.DayOfWeek to get the day of the week.

Assuming you load the ending date in a variable called EndingDate:

If Date.Today.DayOfWeek = DayOfWeek.Monday And Date.Today <= EndingDate Then
'do the insert
End If

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Okay, I see.... I have 6 fields in my DB, mon, tues, wed, thurs, fri ,sat

Now, I want a date inserted in the correct field. so if a monday repeat is selected, I need the date of each monday to get inserted into the monday field with all the other relevant data. how do I insert that date ?

I'm sorry if I'm not understanding correctly

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top