|
||||||
For Next Loops By Richard Rost ![]() ![]() ![]() Use a For / Next Loop to Count Specific Characters in a String In this Microsoft Access tutorial, I will teach you how to use a FOR NEXT statement in Microsoft Access VBA to count the number of time a specific character occurs in a string. We can use this to also count how many lines are in a long text field (textbox). Paul from Houston TX (Silver Member) asks, "I get emailed a (text) list of products every day. Next to each product is a + if that product is new. I need to know both of these counts to put in my daily report. Is there a way I can just copy and paste this text into Access and have it count the number of lines and the number of + it finds?" MembersI'll show you how to create your own function. We will make CountChar into a function that returns a value. We will learn about Rich Text Fields and how to add color and HTML codes to your long text fields. We will learn how to count the number of open ( and close ) in a box and change the colors accordingly to allow you to see where they may not match up.
Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the database template from class plus get access to the Code Vault. If you signed up on YouTube you have to register on my YouTube Find User page so I can set up your account here on my web site. If you're not a member, Join Today!
|
Learn MoreFREE Access Beginner Level 1 Free TemplatesTechHelp Free Templates |
ResourcesMailing List - Get emails when new videos released Questions?Please feel free to post your questions or comments below or post them in the Forums. |
Age | Subject | From | |
9 months | Mistake in video | Sandra Truax | |
9 months | Dim X as string | Sandra Truax | |
3 years | Glossary Chr and Asc | Alex Hedley | |
Check out these other pages that may be of interest to you: |
|
| |||