That is excellent. Where do you learn this? I have a lengthy book on Access but it does not go into any of this.

Where can I learn to code from scratch?
It is hard at first especially when you don't even have the language to phrase a question clearly. But it comes in time.
It is a learning curve. Much of it is passively infused as each step in understanding is slowly and sometimes painfully taken. You see the patterns in the syntax and it all begins to slowly make sense.
The simple stuff gets easier even though it seems nothing ever works without having to go over and over to iron out the bugs. Then one day you find you can type out a procedure and it works first go. It is a good feeling.
Remember that (virtually) everything you can do in design mode of Access can also be done in VBA. So for example when you see Caption is a property of a Control object you try Controlname.Caption and sure enough it is there. Drop the spaces in properties with two words.
One of the really heartening things is that you can presume that anything can be done and persistence will always win with the help of sites like this. If you want to do something, image how it might be done and go looking for the kind of words you might expect.
The autoprompt in the VBA Editor is very useful. Trawl through its suggestions until you see a likely candidate for the property or method you want. Try it and see. Or press F2 for the Object browser and search. AFIAK every VBA property and method is listed in there.
Don't be afraid to try something. Trial and error reveals what doesn't work and this knowledge can be as enlightening as what does work. Have a scratchpad database to test concepts on and always keep a fairly up to date backup of your real work in case you accidentally discover a command to wipe out something important.
Finding the code to do the job is really only the trimming. The foundations are envisioning the constructs you need to achieve the goal. Map out the bones of your complex procedures in comments first and then fill in the meat.
I've never actually studied Access from a book. Google is the developer's friend. It will find postings of similar problems, usually accompanied by the answers and often along with some more of the background information.
Read other peoples problems here. I have stumbled across many new techniques and solutions to problems I hadn't even encountered yet.
Most of all experiment and persist until you achieve what you set out to do. It is a hard road but learning how to program in Access is ultimately really rewarding.
There is no end to challenges if you want to do complicated things. Developers with ten years experience will still tell you they are learning new stuff all the time.