Introduction to Programming in Visual Basic for Applications (VBA) in Microsoft Access (Access VBA)
HTML-код
- Опубликовано: 28 сен 2024
- In this video, I'm going to teach you how to start programming in Microsoft Access VBA. If you've never done any programming before, don't worry. I'll show you how to get started and walk you through it step by step. We will learn how to work with the VBA Editor, create a MsgBox, learn how to open a form with DoCmd.OpenForm, and set a value in a form field.
Patricia from Ann Arbor, Michigan (a Platinum Member) asks: I've seen in several of your TechHelp videos where you mention "you can do this with a couple lines of code." I've been using Access for a few years, but I've never done any VBA programming before. Can you tell me where do I put this code, and how do I get started?
Silver Members and up get access to an Extended Cut of this video. Members will learn how to create a button to open a form to a specific record. We'll put a customer list box on the main menu. Pick a customer, click the button, and that customer's record will open. Then we'll learn about Event programming. We'll use the On Double Click event to do the same thing by just double-clicking on that customer list box. Then we'll learn about the If / Then / Else statement. If the user doesn't pick a customer from the list and then click the open button, then they will get an error message. Lots more too!
MEMBERS VIDEO:
• Intro to VBA. MEMBERS ...
BECOME A MEMBER:
RUclips: / @599cd
or My Site: 599cd.com/THMe...
LEARN MORE:
599cd.com/Intr...
LINKS:
Free Intro VBA Template Download: 599cd.com/Intr...
Blank Database Video: 599cd.com/Blank
Access Developer Level 1: 599cd.com/ACD1
Concatenation: 599cd.com/Concat
Contact Management: 599cd.com/Cont...
Invoicing: 599cd.com/Invo...
AfterUpdate: 599cd.com/Afte...
String Functions: 599cd.com/Stri...
MsgBox: 599cd.com/MsgBox
Quote, Invoice, Receipt: 599cd.com/Quot...
Value From a Form: 599cd.com/Form...
Favorite Customers: 599cd.com/Favo...
On Click Event: 599cd.com/OnClick
COURSES:
FREE Access Beginner Level 1: 599cd.com/Free1
$1 Access Level 2: 599cd.com/1Dollar
FREE TEMPLATE DOWNLOADS:
TechHelp Free Templates: 599cd.com/THFree
Blank Template: 599cd.com/Blank
Contact Management: 599cd.com/Cont...
Order Entry & Invoicing: 599cd.com/Invo...
More Access Templates: 599cd.com/Acce...
ADDITIONAL RESOURCES:
Donate to my Tip Jar: 599cd.com/TipJar
Get on my Mailing List: 599cd.com/YTML
Contact Me: 599cd.com/Contact
TechHelp: 599cd.com/Tech...
Consulting Help: 599cd.com/DevNet
Twitter: / learningaccess
en.wikipedia.o...
products.offic...
microsoft.com/...
KEYWORDS:
microsoft access, ms access, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #instruction, #learn, #lesson, #training, #database, VBA, Choose Builder, Code Builder, Project Pane, Properties Pane, Immediate Pane, MsgBox, parameters, optional parameters, DoCmd.OpenForm, Set Value, Turn Off Choose Builder Box, Options, Object Designers, Always Use Event Procedures, Open Form to Specific Record, On Double Click Event, On Dbl Click, DblClick, If Then Else, Microsoft Access VBA, Access VBA Tutorial, Access VBA for Dummies
QUESTIONS:
Please feel free to post your questions or comments below. Thanks.
I cannot believe I just did my first VBA coding which was complicated enough. Like Patricia, I've been using Access for many years but not VBA. the "Coding" was so scary for me, but I DID it. Thank YOU, THANK YOU, THANK YOU!
You certainly are a very gifted trainer. Much appreciated thank you.
You are very welcome, and thank you for the compliment.
Great job Richard, and excellent teaching.
Thanks
Lol, just watched this tutorial and fell out of my chair when you mentioned programming on a Radio Shack TRS-80. We use to call trash-80s. Ah, storing data on cassette tapes, the good days all came rushing back❤
I still remember the sound of my TRS-80, 300 baud modem connecting to the local BBS...
Richard, if you are still out there? I just want you to know that "YOUR THE MAN!"
Still here. Thanks. :)
MR. Richard, Hello, Thank you for your Tech help.
Welcome
I love your videos!!! Thank you so much sharing all of your knowledge.
You are so welcome!
Thanks Sir!
Very useful and helpful exercise
I had also needed it a lot, because I had worked on the Visual FoxPro Programing before it where VBA is not use , so sometimes it is very difficult to me to work on the VBA.
You are welcome!
Just brilliant !!! second to none....
Thanks I appreciate that
Sorry how can I command save by using code, and after save I want my registration form to direct me to new field
Your lessons are very helpfull. I am only stuck at 1 point: with the +1 button you state that "whatever the value is, it will add 1. But what if the value is empty (I do not want to start at zero) I need this to count my stock but if I fill in zero on al the articles it will go wrong when I import the file and have not counted all my stock....
599cd.com/Ask
interested in your course for VBA is their any reduced rate for the complete course list available
very helpful thank you very much respected sir
Most welcome
Dear sir, Where can I found the discription for VBA commands such (docmd. , me.) . regards
599cd.com/Developer
Hello Dear
Thanks for your valuable videos
I am trying to code an If statement between a subform and another separate form.
I need after updating a Combobox in the subform to set an if statement: ( If the record in a field in the form equals the value updated in the combo box then a field in the same raw in the form becomes true )
Could you please advise about the VBA Code.
Thanks.
599cd.com/AfterUpdate
I remember the halcyon days when Access put code behind the buttons instead of marcos. Yeah, I'm old.
Yeah, that's going back to like 2000/2003, I think
@@599CD I go back to version 2. About the same amount of time as you!
that within a second of you mentioning "but first a word from our sponsors, and that's me!" You had me laughing so hard, that I just had to stop the video and comment. I didn't realize that you had both the color of your skin and your sex changed to an attractive Black woman promoting some college courses! Thank you RUclips for a good laugh LOL . But of course I clicked on the Skip Ad after a few seconds and returned to your video.
Ha ha. Black woman selling college courses, eh? RUclips must have just randomly placed a "real" ad at that spot in my video, because all I did was mention one of my other courses at that moment. But, I'm glad you got a good chuckle out of it. I do aim to entertain as well as educate. LOL
And hey... don't skip those ads! I need that 0.00003 cents from you watching that black woman! :)
Hello Mr. Richard, I joined today this RUclips channel, it's really interesting and helpful. I'm quite new in this VBA in ACCESS and I looking for help for the following: I creating a database of staff members for our organization and since we're people from all over the world we have many different First Names, either one or two up to 3 or 4. And either with or without dash -. Also the length is variating a lot, but I need to specify this because I don't want people to make mistakes when they enter the data. Every single name should start with a capital letter. Where can I find help for this. Thank you Christian
You make learning so much fun. Thank you for sharing your invaluable knowledge.
My pleasure!
Thank you ......
I can't use docmd.close while opening other form
Okay
What are the odds that just yesterday I was looking for exactly this… THANK YOU!!! 🤩
100% LOL - you're very welcome.
Dear Richard,
I trust that this message finds you well. I am writing to express my gratitude for the exceptional training courses you have made available on RUclips. Your teachings have proven to be immensely valuable, and I eagerly look forward to learning more from you.
In light of this, I kindly request that you provide me with the direct links to your other courses. I am certain that these resources will further enhance my understanding and contribute to my personal growth.
Thank you for your unwavering dedication to sharing your knowledge and expertise. Your cooperation and attention to this matter are greatly appreciated.
Warm regards,
Ebo❤
Hey Richard, i have a question. I may sound silly in this but i will highly appreciate if you'd help me in this. imagine a scenario in which a customer has ordered two products of different values (say 200 dollars and 450 dollars). Here, I want to create a query table that shows the orders of 200 or above for a customer if he as at least one order of value 400 or greater? There are thousands of customers and orders are also in thousands.
Richard you're the best. King of Ms Access.
Thank you Richard, easy to understand, thanks.
Very welcome
Do you still read all comments? ACCESS!!!
Yup
Hi Richard - I am working on building out an Access database for a small business company in my town and I have a few questions. I wondered if you take paid consultation hours? Could I schedule some time to speak with you on the phone or over Zoom to communicate their specific wants/needs and get your assistance on how to apply them? Thank you so much.
Hi there, did you ever come right?
Sorry I don't do one-on-one consultations but you can see this page for people who might be able to help you 599cd.com/DevNet
how can I calculate age via VBA on the Age field inside the table. Thank you.
599cd.com/Age
Hi Richard. How do I become a member?
Click the blue Join button on RUclips or go to 599cd.com/THM
Love your work!
Thx