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 Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Have Fun with Coworkers
Adam Schwanz 
           
2 years ago
I regularly include funny little things and easter eggs in updates out of boredom, like sending people to get rick-rolled, or opening/closing programs for fun, or making a constantly moving checkbox that appears at random locations of the screen a few times a second to try to catch. This is the latest one, really simple, you can include a timer event if you want the screen to really go crazy, but you should probably include an Epilepsy warning if you do. Anyone else do anything fun to mess with their co-workers? :).

This randomly assigns one of the background colors, and each button it's own background color. You could make it a lot more advanced but this was just a quick one :P.

        Dim randomValue, randomValue2

        Randomize
        randomValue = Int((6 - 1 + 1) * Rnd + 1)
        
        If randomValue = 1 Then
            Me.Detail.BackColor = vbRed
        ElseIf randomValue = 2 Then
            Me.Detail.BackColor = vbWhite
        ElseIf randomValue = 3 Then
            Me.Detail.BackColor = vbGreen
        ElseIf randomValue = 4 Then
            Me.Detail.BackColor = vbBlack
        ElseIf randomValue = 5 Then
            Me.Detail.BackColor = vbYellow
        ElseIf randomValue = 6 Then
            Me.Detail.BackColor = vbBlue
        End If

        Dim ctl As Control
        For Each ctl In Me
            If TypeOf ctl Is CommandButton Then
            randomValue2 = Int((6 - 1 + 1) * Rnd + 1)
                If randomValue2 = 1 Then
                    ctl.BackColor = vbWhite
                ElseIf randomValue2 = 2 Then
                    ctl.BackColor = vbRed
                ElseIf randomValue2 = 3 Then
                    ctl.BackColor = vbBlue
                ElseIf randomValue2 = 4 Then
                    ctl.BackColor = vbGreen
                ElseIf randomValue2 = 5 Then
                    ctl.BackColor = vbBlack
                ElseIf randomValue2 = 6 Then
                    ctl.BackColor = vbYellow
                End If
            End If
        Next ctl
        
        'If using a timer event you can include this for extra chaos :)
        'If randomValue = 1 Or randomValue = 2 Or randomValue = 3 Then
        '    DoCmd.Maximize
        'Else
        '    DoCmd.Restore
        'End If
Adam Schwanz OP  @Reply  
           
2 years ago

Richard Rost  @Reply  
          
2 years ago
Haha. I did something like this a while back with a moving checkbox. When the mouse hovers on it, it moves over slightly then back to its original position. LOL. Ooooohhh... I should save this for an April Fool's joke. :)
Sami Shamma  @Reply  
             
2 years ago
Adam, what's with the color choice? I am getting a seizure

Adam Schwanz OP  @Reply  
           
2 years ago
Thanks @Rick, the next prank is already setup for the next update. All the text boxes/buttons etc on the form will run away from the mouse LOL. I'll include a button to turn it off, I'm not THAT evil ;)

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access 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/2/2026 12:20:39 AM. PLT: 0s