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 > Scroll Wheel & Continuous Forms 2 < Scroll Wheel & Continuous Forms | Edit Linked Excel Data >
Back to Scroll Wheel & Continuous Forms 2    Comments List
Pinned    Upload Images   @Reply   Bookmark    Link   Email  
Transcript
Richard Rost 
          
8 months ago
Welcome to another TechHelp video brought to you by AccessLearningZone.com. I'm your instructor Richard Rost. Today is part two that I wasn't even planning on making for the scroll wheel and continuous forms video. I made part one, thought that was it, but then I got a comment from one of my members who had a much simpler solution to what I showed you in part one.

So if you haven't watched part one yet, I show you how to make a subform down here, which will then allow you to scroll the mouse wheel up and down here without this part scrolling. This is okay, and I'm still going to leave this video up because this is a decent method. It's an expert method, which means it doesn't involve any programming.

If you're one of those people that doesn't want to use VBA anymore, this method is perfectly fine. In the extended cut, I showed the members how to automatically have this subform resize based on the size of the subform object. That was pretty cool too. They are all good tips to have.

Then I got a comment from Damien, one of my silver members. He says you can also fix this with two lines of VBA. I'm got focus and an on lost focus. It's me.scrollbars, which basically says you're turning the scrollbars off on the parent form, on the continuous form, when the text box gets the focus.

I looked at it and I was like, no, it can't be that simple. This is genius. I love this. I love, love, love when you guys teach me something. Of course, I had to try it immediately. Let me walk you through it.

Of course, real quick, this is a developer lesson. If you've never done any VBA programming before, go watch this video. It will get you started in about 20 minutes. But today's really simple. It's just two lines of code.

All right. So here I am in the TechHelp free template. This is a free database you can download from the website if you want to. We can start with yesterday's database too. But I'm just going to go right into the customer list. We put a note field down here on the bottom.

I stole that note field from the customer form, which already has a notes field. We'll just copy that and come down to here, go to design view, paste it in here. Okay. All right. Now we'll save this and then come back into it.

The problem we have is you can scroll with the wheel up here. But if you click down here and scroll, it also scrolls the records up top, which is undesirable. In part one, I showed you that you can just make this a subform and that gets rid of that problem.

Here's Damien's genius idea. All you do is you turn off the scroll bar when this field gets the focus. The focus is wherever you're sitting right now. Last name is focus, right? Customer ID has focus. When the notes field gets the focus, turn off the scroll bar.

Go into the notes field, go to events, and find on got focus. There's got focus and lost focus. Go to got focus. In here, we're going to say me. Now remember, me represents the form. Me is not the control; me is the form. So me.scrollbars = 0 (0 is off).

Then we'll go to the lost focus event, which you can get right here, and type me.scrollbars = 2. Two is vertical. If memory serves, 1 is horizontal only, and I think 3 is both, but I'm not sure. Let me look it up real quick. Yeah, that's right. Zero is off, one is horizontal, two is vertical, and three is both.

Save that. Always throw in a debug compile. We can close the VBA editor, close the form, and reopen it. Now I can scroll up here. If I click down here, look at that, the scroll bar disappeared up top. Now I'm scrolling down here. If I decide I want to click back up top, I can do that again. See, isn't that nice?

You have to give the text box focus by clicking on it first for these ones. That's not a big deal. If you come over here, you also have to click up here, but I like it. It's a good solution. It's beautiful. Like I said, I love it when you guys teach me something. That's wonderful.

So that's it for today. Nice and short and simple and sweet. I wasn't planning on doing a part two, but there's your part two. Thank you, Damien, for the tip. That's 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.

TOPICS:
Scroll wheel and continuous forms part 2
Creating a subform to manage scrolling
Resizing subform based on object size
Using VBA to control scrollbars
Setting up 'On Got Focus' and 'On Lost Focus' events
Disabling scrollbars on focus
Enabling scrollbars on lost focus
Debugging and compiling VBA code
Testing scroll behavior in forms

COMMERCIAL:
In today's video, I'm going to show you a quick, two-line VBA solution to fix an issue with scroll bars in continuous forms. If you haven't seen part one, don't worry - I'll explain everything. We start by adding a note field to the customer list, then solve the undesired scrolling problem with a subform. But thanks to a tip from one of my members, you'll learn to control scroll bars using 'Got Focus' and 'Lost Focus' events. It's a simple yet effective trick to make your Access forms more user-friendly. You'll find the complete video on my YouTube channel and on my website at the link shown. Live long and prosper, my friends.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Scroll Wheel & Continuous Forms 2.
 

 
 
 

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: 5/23/2025 3:18:39 PM. PLT: 1s