Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to VBA Editor Themes 3    Comments List
Pinned    Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Transcript
Richard Rost 
          
2 years ago
Today is part 3 and the final part of my VBA Editor Themes series, where we're making a little theme editor for the VBA editor. So, you can have a dark mode, a light mode, a teaching mode, a grandpa mode, whatever you want, any kind of mode. And of course, if you haven't watched parts 1 and 2 yet, go watch those first. You'll find links down below.

Alright, let's get back to it.

Alright, so we made our button to read the settings from the registry. Now let's make another button to put them back into the registry. So, design view, I'm just going to copy this button here, copy, paste, slide it over here. Come on, there you go. Get it right, there you go, okay, good boy.

Alright, we're going to do put settings to registry. Alright. And what do we call this button? This is the get settings button. We'll call this one the put settings button. Put settings button. Alright.

Very similar logic, a little bit differently. Right-click, build event. Alright. Same thing. We're going to first check to make sure that we have a valid ID. I'm also going to check to make sure there's a value in the other fields, too. Make sure none of those are missing.

Alright, so let's copy and paste, paste, paste, paste. Let's do this a couple of times. Whoops. Paste. Alright, and we're just going to check the other values, too. So, "code back colors" is invalid, "code back". And you can put friendlier messages in here if you want. I just want to make sure that there wasn't a problem before, and that there's a blank value in one of these, and that we're going to put garbage to the registry because that would be awful. We don't want garbage in the registry.

Okay, so there. We've checked all five things that we have to write back.

Now, just like this one was "read key", we're going to use the "save key". So, we're going to just copy this whole thing here and paste it. And this is going to be, instead of setting something equal to, it's going to be "save key". Okay, and this is not a function anymore; it's a statement. So, we're going to add a space there instead. Alright, that's the registry key. The value is "code back colors". Now there's a third thing here that says "reg sz". What is that?

Let's take a peek at this real quick. Right-click, definition. Okay, in here I put the different types. "Reg SZ" is basically a string. It's the default value. Alright, most things in the registry are strings. Then there's this thing called a DWORD. It's basically a 32-bit number. It's roughly equivalent to a long integer in Access. Okay, so for numbers, you're going to use a DWORD. For string values, you're going to use SZ. These two things, don't worry about them. Don't mess with them, don't touch them, don't play with them; they're a lot more advanced, and maybe one of these days I'll do a class on them, but for now, all you have to worry about is these two things.

So, the only thing we have to do is, if we're using a number like our font size, our font height, we have to specify "reg dword". Okay, and we just send that as a string.

Alright, let's go back. Okay, so here's that, we got the "code back colors", we're going to copy this three more times, paste it three more times. Paste, paste, paste. Okay, grab these, "code fore colors", goes into this one, "font face" goes into this one, and then "font height" is getting "font height", and here we have to go "comma reg_dword". You can copy that right out of the thing if you want to.

Okay. Now at this point, the registry's been updated. But Access reads these settings in when Access loads. So, you're not going to see it change until you restart Access. So we're going to just tell the user, "Message box, settings updated, please restart Access."

Alright. Yeah, there's code we could do that. But no. No, we're not gonna. Just restart it. That's a whole different class.

Alright. Debug. Compile. Close it. Close it. Save it. Open it. Alright. What are we in right now? We're in light mode. Alright. The one we just set last. I'm going to click on dark mode and put settings to registry. Click. Alright. Settings updated. Please restart Access. Notice now you don't see a change. Alright, we have to actually restart Access. So let's close that down and let's restart the database.

And here we go. And ready. Click. Let's go back. Where's my form? It could be a theme path. Go to light mode. Put settings to registry, hit okay, restart Access. One more time. Yeah, my system's slow today, I don't know why. And peak. And, ooh, look at that. Isn't that cute? And then our own little theme editor.

Are there other settings you can change? Yeah, these are the big ones, though. These are the big four. I wouldn't mess with anything else. Just stick with these. And I did this for you guys, so I can leave it like this in videos and I can switch back to black for myself. Well, okay, so it's kind of selfish. It's for me, too.

So there you go. There's your VBA Theme Editor. Pretty cool, huh?

If you like this stuff, if you like learning with me, if you like my style, and you like learning how to do cool things in Access VBA. Well, I got tons of developer lessons available on my website. Sign up today, you can become a Learning Connection member and you get a discount. If you're a Platinum member, you can get a free developer class once a month after you've finished all the beginner and expert lessons. So there's lots and lots of stuff that I cover from beginner to advanced. So everything that I know, well pretty much everything that I know, is in these lessons. I've baked me in there. It's like that spaghetti sauce. It's in there.

But that's it. That's all for your TechHelp video for today. I hope you learned something. I hope this series was helpful to someone out there. Post me a comment down below. Let me know what you thought. Live long and prosper, my friends. I'll see you next time.
Richard Rost OP  @Reply  
          
2 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in VBA Editor Themes 3.
 

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/1/2026 8:00:03 PM. PLT: 1s