Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Calendar Seminar Lessons    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Calendar problem
Alan Hill 

16 years ago
Hi Richard Hope you can point me in the right direction please. This is where I am at.
Private Sub OpenCalendarForm_Click()
Dim x As Integer
Dim S1 As String, S2 As String, IsHoliday As Integer, GetID As Integer
Dim MySql As String

    CalculateStartDate
    
    DoCmd.OpenForm "MonthlyCalendarF"
For x = 1 To 42
    S1 = "Date" & x
    S2 = "Day" & x
    If Month(Forms!MonthlyCalendarF(S1)) <> Month(Calendar) Then
        Forms!MonthlyCalendarF(S2).BackColor = &HD8D8D8
    Else
        MySql = "'DateTime>=Forms!DatePickerF!StartDate +" & x
        MySql = MySql & " AND DateTime        
        ' tried Dlookup("Holiday","DateQ",mysql) that did not work
        ' so now try to get the ID then use "CalID=" & Getid
        ' that does not work either. Dlookup is not reading the correct values
        
        GetID = DLookup("CalID", "DateQ", MySql)
        IsHoliday = Nz(DLookup("Holiday", "DateQ", "CalID=" & GetID))
        
        'MsgBox GetID & " - " & IsHoliday
        ' result is always 1
        
            If IsHoliday = 1 Then Forms!MonthlyCalendarF(S2).BackColor = vbYellow ' School Holiday
            If IsHoliday = 2 Then Forms!MonthlyCalendarF(S2).BackColor = vbBlue ' Public Holiday
            If IsHoliday = 3 Then Forms!MonthlyCalendarF(S2).BackColor = vbGreen ' Student Free Day
  
    End If
Next x

End Sub

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Calendar Seminar Lessons.
 

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: 6/11/2026 4:14:28 PM. PLT: 1s