Senin, 20 Mei 2013

RE: [MS_AccessPros] Recurring events

 

Kumar,

I have something similar in which I just append forward to a little table.

Public Sub SetUpReportData()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Dim strsql As String
Dim datMovDate As Date
Dim datEndDate As Date
' Initialize work
datEndDate = Date + 30
CurrentDb.Execute ("Delete * from tmpMonthForReport")
CurrentDb.Execute ("Delete * from tmpForReport")
For datMovDate = Date - 7 To datEndDate
strsql = "INSERT INTO tmpMonthForReport (TheDate) " & _
"VALUES (#" & datMovDate & "#)"
CurrentDb.Execute (strsql) ' create template for the calendar style report
strsql = "Select * FROM DateLog WHERE BeginDate = #" & datMovDate & "# " & _
"OR EndDate = #" & datMovDate & "#;"
Set rs = db.OpenRecordset(strsql)
While Not rs.EOF
If datMovDate = rs("BeginDate") Then
strsql = "INSERT INTO tmpForReport ( OffSiteLocation, Employee, TheDate, Comment, Manager ) " & _
"VALUES ('" & rs("OffSiteLocation") & "', '" & rs("Employee") & "', #" & rs("BeginDate") & "#, '" & Nz(rs("Comments"), "") & "', '" & Nz(rs("Manager"), "") & "')"
CurrentDb.Execute (strsql) ' insert date from Beginning
ElseIf datMovDate = rs("EndDate") Then
strsql = "INSERT INTO tmpForReport ( OffSiteLocation, Employee, TheDate, Comment, Manager ) " & _
"VALUES ('" & rs("OffSiteLocation") & "', '" & rs("Employee") & "', #" & rs("EndDate") & "#, '" & Nz(rs("Comments"), "") & "', '" & Nz(rs("Manager"), "") & "')"
CurrentDb.Execute (strsql) ' insert date from End
End If
rs.MoveNext
Wend
Next
Set rs = Nothing
Set db = Nothing
End Sub

Respectfully,
Liz Ravenwood
Programmer/Analyst
Super First Class Products
B/E Aerospace
O: 1.520.239.4808
www.beaerospace.com

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of access_kri
Sent: Monday, May 20, 2013 9:33 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Recurring events

Dear All,
I am using a Tasklist database. Some of the Tasks are recurring daily, weekly (on same day of the week), fortnightly, quarterly, half-yearly, last day of the month, last Sunday of every month etc. I am desirous of having a form to update the event in my Tasklist database. I will enter the activity, specify the from and to dates and the frequency and on clicking the command button, it will run the query to append the recurring activities between the dates specified. Can someone give a clue how to have these frequency defined in the query?

Kind Regards,
kumar

------------------------------------

Yahoo! Groups Links

This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar