Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Weekly calender code
Abraham Breuer 
     
4 years ago
Hi

Any one to help me out on this code?

Private Sub DisplayAppointments()


    Dim RS As Recordset, RS2 As Recordset, RS3 As Recordset, RS4 As Recordset
    Dim X As Long
    Dim S As String
    Dim Fld As Field
    
    
    StatusBox = ""
    DoCmd.SetWarnings False
    DoCmd.RunSQL "DELETE * FROM AppointmentTempT"
    DoCmd.RunSQL "INSERT INTO AppointmentTempT (SaturdayAppointment) VALUES (""Testing"") "
    DoCmd.SetWarnings True
    
    X = 0
    Set RS = CurrentDb.OpenRecordset("SELECT * FROM AppointmentT ORDER BY AppointmentDay ")
    
    While Not RS.EOF
            If DatePart("ww", RS!appointmentday) = DatePart("ww", DisplayDate) And Year(RS!appointmentday) = Year(DisplayDate) Then
                Status RS!Description & " " & "on " & Format(RS!appointmentday, "ddd d-mmm")

                
                Set RS2 = CurrentDb.OpenRecordset("AppointmentTempT")
                
                For Each Fld In RS2.Fields
                    If Fld.Name = "SundayAppointment" Then
                            If Weekday(RS!appointmentday) = 1 Then
                                If RS2!SundayAppointment = "" Then
                                    RS2.AddNew
                                    RS2!SundayAppointment = RS!Description
                                    RS2.Update
                                Else
                                    RS2.Edit
                                    RS2!SundayAppointment = RS!Description
                                    RS2.Update
                                End If
                            End If
                    End If
                    
                    If Fld.Name = "MondayAppointment" Then
                            If Weekday(RS!appointmentday) = 2 Then
                                If RS2!MondayAppointment = "" Then
                                    RS2.AddNew
                                    RS2!MondayAppointment = RS!Description
                                    RS2.Update
                                Else
                                    RS2.Edit
                                    RS2!MondayAppointment = RS!Description
                                    RS2.Update
                                End If
                            End If
                    End If
                    
                    If Fld.Name = "TuesdayAppointment" Then
                            If Weekday(RS!appointmentday) = 3 Then
                                If RS2!TuesdayAppointment = "" Then
                                    RS2.AddNew
                                    RS2!TuesdayAppointment = RS!Description
                                    RS2.Update
                                Else
                                    RS2.Edit
                                    RS2!TuesdayAppointment = RS!Description
                                    RS2.Update
                                End If
                            End If
                    End If
                    
                    
                    
                Next
            X = X + 1
            RS2.Close
            Set RS2 = Nothing
            End If
        RS.MoveNext
    Wend
    
    Status CStr(X) & " Appointments week of " & DisplayDate
            
    RS.Close
    Set RS = Nothing
    
    Me.Requery
    


End Sub

Abraham Breuer OP  @Reply  
     
4 years ago

Abraham Breuer OP  @Reply  
     
4 years ago

Abraham Breuer OP  @Reply  
     
4 years ago

Abraham Breuer OP  @Reply  
     
4 years ago
the Calendar form is a continuous form and does not show up the remaining appointments of this week only in the status box...

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 11:26:53 AM. PLT: 0s