4 minutes ago: Please note that the webserver will soon get its weekly reboot at 4:00 am Eastern Time. You may continue to use the site as normal, but you will be logged off at that time. You should be able to log right back on immediately, however. If you are in the process of placing an order, please make sure to complete it as quickly as possible, or come back after the reboot. Thank you. Sorry for any inconvenience.  Dismiss
 
Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Form Shadow < Delete Files | List Box Move Item >
Form Shadow
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   23 months ago

Give Your Access Forms a Dark Visible Shadow


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Join Now

In this Microsoft Access tutorial, I'm going to show you how to put a dark shadow under your forms, and we will also learn how to resize the shadow when the original form is resized.

Members

Members will learn how to move the shadow if the form on top of it is moved. This is a little more tricky and involves a bit more programming.

Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today!

Prerequisites

Links

Recommended Courses

Learn More

FREE Access Beginner Level 1
FREE Access Quick Start in 30 Minutes
Access Level 2 for just $1

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Diamond Sponsors - Information on our Sponsors
Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted
Merch Store - Get your swag here!

Questions?

Please feel free to post your questions or comments below or post them in the Forums.

KeywordsForm Shadow in Microsoft Access

TechHelp Access, Access forms shadow, dark shadow forms, resize form shadow, dynamic shadow resizing Access, Access form design tips, visual enhancement Access forms, Access form border shadow

 

 

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Form Shadow
Get notifications when this page is updated
 
Transcript Welcome to another TechHelp video brought to you by AccessLearningZone.com. I'm your instructor, Richard Rost.

In today's video, I'm going to show you how to give your Access forms a dark shadow. Ooh, like the old vampire series Dark Shadows. We're going to have dark shadows under our form. Look at that. Ooh.

Got your database here, open up your customer list, open up a customer, and oh, look at that dark shadow. Ooh, nifty.

Now this is a developer level video, which means we're going to be using some VBA. If you've never done any VBA programming before, watch this video first, about 20 minutes long. It'll teach you everything you need to know to get started.

I'm going to start off this video by saying that this works. It's not necessarily the best method for doing this. I've seen some third-party utilities that do it better, and you could probably do it better with some advanced Windows API calls.

But if you know me, and if you've been watching my videos for any length of time, you know that I like to do as much as possible within the confines of Access. I don't like to use third-party tools. I try to avoid Windows API calls if I can, although sometimes it's unavoidable.

So I'm going to show you a trick, a technique for doing this with just Access objects. It's not great. It works. There will maybe be a tiny little bit of flicker if you click on this, maybe resize, there's a little bit of flicker, but it works. It's good enough.

I use this to draw attention to a form, usually like a dialog form, or something like a custom message, a pop-up. You don't want to do this with all your forms. It will clutter the interface, but it does the job.

I'm going to start off here in my TechHelp free template. This is a free database. You can grab a copy off my website if you want to, but what I'm going to show you is going to work with pretty much any database, so you don't have to use mine. You do have to be using Overlapping Windows though. If you're using the tabbed interface, it's not going to work for you.

I like the overlapping windows. I have a video just on that if you want to see how to use it. Go watch that, I'll put a link down below.

We're going to create a form that is basically one big black shadow, or you can use gray if you want to.

I'm going to take any form, I'll just take the main menu for example, copy it, and paste it. We're going to call this the ShadowF, the shadow form.

Design this guy in design view. You can delete all of the objects off of it.

If there's any code behind it, go and delete that code. Here I am in the code editor, just get rid of all this stuff because we don't need any code in this form. Save it.

Then, make this background here whatever color you want your shadow to be. You can go dark gray, you can go black. I'm going to go black because it shows up the best. If you want a light shaded gray, fine. It's not going to be transparent at all because Access doesn't support transparent forms. Notes to developer team: transparent forms would be pretty cool. I know Access isn't really for graphical type stuff, but it would make some things neat.

You can reshape this and size it however you want. I'll make it small because we're going to size it to the form that it's behind in just a minute.

There's my shadow form. Now, we also have to do one more thing. We have to turn off the border around the form so that doesn't show up. Go into design view again.

Go to properties. Now, this is my main menu form, so some things like the record selectors and the navigation buttons, I already turn those off on this. Navigation buttons is No, record selectors is No, scroll bars is Neither, control box, you can turn that off, turn the close button off. Set the border style right there to None. Save it. Close it.

Now when you open it up, you're just going to get a black box like that. There's really nothing you can do on it. You can't click on it, can't do anything. The only way you as a developer can get rid of it is to right-click on it and go back to design view, which your end users won't be able to do because we turned that stuff off. I covered that in my security videos. They can't right-click and do stuff like that.

Go ahead and close it now.

Now we're going to need a little bit of code so that when we open up whatever form we want the shadow behind, it opens up the shadow form.

Let's put it in the customer form. Pick any form you want, and yes, you'll have to do this with each form that you want to put the shadow behind. Again, I save this very sparingly for stuff I want to have a shadow behind.

In this form, go to its events. You can either use the On Open or the On Load event. Doesn't matter, they do roughly the same thing.

Where's On Load? Right there, On Load. When this form loads up, we are going to do "shadow."

That's it, we're done.

I'm just kidding. We have to tell the system what "do shadow" is, so we're going to make our own subroutine up here.

Private Sub DoShadow

What are you going to do, DoShadow? We're going to do DoCmd.OpenForm "ShadowF".

Now that that form is open, we're going to MoveSize it.

Where are we going to MoveSize it to? The dimensions of the current form: the left, the top, the height, and width. Just move it over to the right and down a little bit, or up and left, or wherever you want the shadow to be. It's real simple, watch this.

So it's DoCmd.MoveSize. Now, since the other form is open, that's the one that's getting MoveSized. It's whatever the last object that you're working with is.

The right command, I know it's a little confusing because we've got to mix right and left a little bit here. It's Me.WindowLeft, that's the left most coordinate of Me. What is Me? Me is whatever object you're in, so it's the CustomerF.

So it's the CustomerF's WindowLeft plus, we're going to move it over 100 pixels. Is it pixels or twips? I can't remember, I think it's pixels, I'm not sure, it doesn't matter. You can resize this as much as you want. You can make it 50 if you want less of a shadow, 200 if you want more of a shadow. I think 100 looks good.

What's the down coordinate? Well, it's Me.WindowTop. I know, confusing. Sorry, I didn't come up with this stuff, I'm just showing you guys how to do it. Plus 100, that'll move it down 100 units.

Now, the width and height are just going to be the width and height of the window you have. Obviously, you can make it bigger or smaller. If you want one of those effects where the shadow is larger than the form, whatever you want there, your leg goes, put them together however you want to. Me.WindowWidth, and Me.WindowHeight.

There you go, just going to move the window right a little bit, down a little bit, and the same height and width of the form that it's under.

Now, when we're done with that, we don't want the shadow form sitting on top. So we're going to reopen the form that we're on, so DoCmd.OpenForm Me.Name. That's the name of the current form that you're working in, you don't have to change that every form that you put this in.

So the form loads up, it's going to do the shadow. Save it. Do a quick debug compile, make sure it's working.

Close it, close it, open it. Ooh, there's our shadow.

Now when this thing closes, it's leaving that shadow form behind, so we have to tell our customer form to close the shadow form when it closes. Right-click, design view so I can close this guy.

Go back into the customer form. Design view.

Go back to your code.

Now we need your Form_Close event. Come up here, Form_Close or Unload, either one, there's Unload, that'll work too. The only difference between Load/Open and Unload/Close is that one of them can be cancelled, one runs first and gives you the option to cancel it. Like, you could do some data validation and check to make sure stuff is the way you want it to be, and you can cancel the Unload. But for what we're doing in this video, it doesn't matter, they both do the same thing.

Here, all we have to do is close the shadow form, so DoCmd.Close acForm, "ShadowF", and then I always put acSaveYes in there. Lots of reasons why. This is mostly for you, the developer, because your end users, they're working with ACCDE files, they can't save anyways, so that's not for them. That's for you when you open a form in design mode, you go make some changes, and then you run it and your code closes the form and doesn't save your changes. I hate that.

Save it and back out. Close it, open it, close it, and your shadow goes away.

That's pretty cool.

What if the user resizes the form? Well, that doesn't resize the shadow, huh? That's easy to fix. There is a resize event.

Right-click, design view, open up in here, find the On Resize, right there, and just throw in here DoShadow. There's a reason why I made a custom subroutine for that earlier, because I'm going to be using it again.

Save it, come back out. Close it, close it, open it, and now your shadow will resize. Look at that. Ooh.

It's not perfect, there's a little flickering, but it works.

Want the shadow to be bigger or smaller? Just change these numbers, 200, 200. You can make these constants if you want, I don't care.

Close it, open it, now you have a bigger shadow.

To change the color of it, you can just change the color of the form.

Here's the one problem that you do have with this: if the user moves the form, unfortunately, there is no default Access event that runs when a form is moved, so they will leave the shadow behind.

Unfortunately, this is a little trickier to code. It's a lot more involved, and I will cover how to do that in the extended cut for the members. Silver members and up get access to all of my extended cut videos. There are lots of them, folks, there are hundreds of them. Of course, Gold members get access to download these databases that I build in the TechHelp videos and the Code Vault, which has lots of cool stuff in it.

If you like learning with me, if you like this kind of programming type stuff in your Microsoft Access, check out my developer lessons. I have tons on my website. I have 45 of them as of right now, it's January of 2024, and I try to release one every month if I can. There are lots online, check them out.

That is going to be your TechHelp video for today. I hope you learned something. Live long and prosper, my friends. I'll see you next time.
Quiz Q1. What is the main purpose of using the shadow form technique described in the video?
A. To add a visual effect under specific Access forms to highlight them
B. To increase data security in Access databases
C. To enable transparent form features in Access
D. To replace the need for overlapping windows in Access

Q2. According to the video, when is it best to use the shadow form effect?
A. On every form in your database interface
B. On dialog or pop-up forms to draw attention
C. Only on tables that display customer information
D. Exclusively for navigation menu forms

Q3. What Access feature is REQUIRED for the shadow form technique to work?
A. Tabbed Documents interface enabled
B. Overlapping Windows interface enabled
C. Use of third-party form utilities
D. Access macros for all form events

Q4. What type of object should the shadow form be created as?
A. Report
B. Table
C. Form
D. Query

Q5. What is the main color suggested for the shadow form in the video?
A. White
B. Red
C. Black or dark gray
D. Blue

Q6. What must you do to the shadow form to make the shadow effect visually appealing?
A. Change its record source to a table
B. Remove border, navigation buttons, scroll bars, and record selectors
C. Set its background image to a pattern
D. Enable all default form controls

Q7. Why do you need to remove all code behind the shadow form?
A. To ensure the form loads as quickly as possible without unnecessary functionality
B. To prevent accidental data entry
C. To enable transparent backgrounds
D. To reduce the size of the database file

Q8. When opening a form with a shadow, what Access event is typically used to initiate the shadow subroutine?
A. On Click
B. On Dirty
C. On Open or On Load
D. On Got Focus

Q9. What does the subroutine DoShadow do?
A. Creates a new customer record
B. Opens the shadow form, moves and resizes it behind the current form
C. Colors text boxes based on user selection
D. Disables all controls on the form

Q10. How is the positioning of the shadow form determined relative to the main form?
A. By multiplying the dimensions of the current form by two
B. By using Me.WindowLeft and Me.WindowTop plus offset values
C. By hardcoding absolute coordinates
D. By using the position of the main Access window

Q11. What is the role of Me in Access VBA within the code shown?
A. Refers to the main Access window
B. Refers to the form or object that the code is running in
C. Refers to the entire database
D. Refers to a specific control on a form

Q12. Why is DoCmd.OpenForm Me.Name used after moving the shadow form?
A. To bring the main form back to the front
B. To save the shadow form's changes
C. To refresh all open forms
D. To prevent the form from closing

Q13. What happens if you close the main form and do NOT close the shadow form?
A. The database will close
B. The shadow form will remain open in the background
C. The application will crash
D. All forms will minimize

Q14. How is the shadow form closed when the main form closes?
A. Automatically by Access on any form close
B. Manually in code with DoCmd.Close acForm, "ShadowF"
C. By the user clicking the shadow form's close button
D. By setting the shadow form's Visible property to False

Q15. What type of Access form event is used to update the shadow when the main form is resized?
A. On Dirty
B. On Activate
C. On Resize
D. On Timer

Q16. How can you make the shadow bigger or smaller?
A. By changing offset values in the MoveSize command
B. By adjusting the database file size
C. By modifying the Record Source property
D. By changing the form's Allow Edits setting

Q17. What is a known limitation of this shadow form technique discussed in the video?
A. The shadow does not follow the form if it is moved
B. Access does not allow forms to be resized
C. There is no way to close the shadow form
D. You cannot change the color of the shadow

Answers: 1-A; 2-B; 3-B; 4-C; 5-C; 6-B; 7-A; 8-C; 9-B; 10-B; 11-B; 12-A; 13-B; 14-B; 15-C; 16-A; 17-A

DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.
Summary Today's TechHelp tutorial from Access Learning Zone covers how to add a dark shadow effect behind your Microsoft Access forms. This is a great way to visually emphasize specific forms, such as custom dialogs or pop-up messages, making them really stand out on the screen.

To begin, this technique does require some basic VBA programming. If you have not worked with VBA before, I recommend watching my beginner video first. That will get you up to speed so you can follow along with the methods I am going to cover here.

I want to point out that while this trick works, it is not necessarily the optimal approach. There are third-party tools and more advanced solutions available, especially if you are comfortable working with Windows API functions. However, I prefer to use what Access provides natively whenever possible, and that is what I will demonstrate today. You can create the shadow effect purely with Access forms and some simple VBA, keeping everything inside the application.

This method is especially effective when you want to draw the user's attention to a particular form. I typically use it sparingly for important dialogs so as not to clutter the user interface. It works best if you are using Overlapping Windows in Access. If you use the Tabbed Document Interface, unfortunately, this technique will not work for you.

Here is how you can set up the shadow effect. First, you will create a special form that serves as the shadow. You can take any existing form, copy it, and rename it, for example, as "ShadowF." Switch to design view and delete all controls and code from this form so you are left with a blank slate. Set the background color to your desired shadow color – black is the most dramatic, but you could also use a dark gray if you prefer. Access does not support transparent forms, so true transparency is not possible.

You may also want to change several form properties to ensure the shadow form blends in smoothly. Remove all borders, record selectors, navigation buttons, scroll bars, and disable the control box and close button. Set the border style to "None" so that the form appears as a plain rectangle. Once finished, when you open this shadow form, it will appear as a solid, untitled shape that users cannot interact with.

Now, you need to write some VBA code to automate the opening and positioning of the shadow when you open the form you want it to appear behind. Add this code to the form's On Load or On Open event. You will create a subroutine to open the shadow form and then use the MoveSize method to position and size it. The key is to move the shadow form slightly offset behind your main form. Typically, offsetting by about 100 units right and down creates a pleasing shadow effect, but you can adjust this value to make the shadow bigger or smaller.

Once the shadow form is open and placed in the right spot, reopen your main form so that it appears in front of the shadow. This way, the shadow sits just behind the form you want to highlight.

You will also need to add code to close the shadow form when your main form closes. Add this to the form's On Close or On Unload event to ensure the shadow is removed at the correct time. I always include the "save changes" option when closing forms, which is a handy tip for developers who might be making design changes during testing.

If your form might be resized by the user, you will need to update the shadow's size and position as well. Access provides a Resize event for forms. By calling your shadow placement subroutine in this event, you ensure that the shadow always matches any changes the user makes to the form size.

You can further customize this shadow effect by adjusting the size of the offset or changing the background color of your shadow form.

There is one limitation to note: if the user moves the form, Access does not have a built-in event to track this movement, so the shadow will not automatically follow. Implementing shadow movement requires more complex programming and is covered in detail in the Extended Cut for members.

If you are interested in more advanced Access programming lessons, I have many developer-level courses available on my website. There is always something new to learn, and I encourage you to explore the full range of content.

You can find a complete video tutorial with step-by-step instructions on everything discussed here on my website at the link below.

Live long and prosper, my friends.
Topic List Creating a shadow effect for Access forms
Designing a shadow form with custom background color
Removing controls and code from a copied form
Setting form properties to hide borders and controls
Opening the shadow form using VBA
Positioning the shadow form with MoveSize
Calculating offset for shadow positioning
Sizing the shadow form to match the main form
Ensuring the main form appears in front of the shadow
Closing the shadow form when the main form closes
Adjusting shadow size and color
Updating the shadow position and size on form resize
Limitations with moving forms and shadow alignment
 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/14/2025 3:34:35 AM. PLT: 1s
Keywords: TechHelp Access, Access forms shadow, dark shadow forms, resize form shadow, dynamic shadow resizing Access, Access form design tips, visual enhancement Access forms, Access form border shadow  PermaLink  Form Shadow in Microsoft Access