The roots of education are bitter,
but the fruit is sweet.
-Aristotle
 
Home   News   Courses   Seminars   Templates   Help   TechHelp   Forums   Order   Contact   Logon  
 
Home > TechHelp > Directory > Access > For Next
 
For Next Loops
By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   2 months ago

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?"


 S  M  L  XL  FS  

LEARN MORE:
Concatenation: https://599cd.com/concatenation
Enter Key Behavior: https://599cd.com/enter+key+behavior
New Line in Field: https://599cd.com/new+line+in+field
For Loops: https://599cd.com/acd3
Intro to VBA: https://599cd.com/acd1
LEN Function: https://599cd.com/acd8
MID Function: https://599cd.com/acx25
While Loops: https://599cd.com/acd12

BONUS FOR CHANNEL MEMBERS:
Silver Members and up get access to an EXTENDED CUT of this video which covers additional examples. That video will show you how how 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.

MEMBERS ONLY VIDEO: 
https://youtu.be/vjitRRIxK84

BECOME A MEMBER:
https://youtube.com/channel/UCl7-jJie4ifOVK87FINIuDg/join

MEMBERS TOPICS:
Make a CountChar Function
Create Functions: https://599cd.com/acd2
Create Public Module: https://599cd.com/acd11
Exit Function: https://599cd.com/exit+function
DoEvents: https://599cd.com/acd12
Rich Text Boxes: https://599cd.com/acx5
Arrays: https://599cd.com/arrays
Combo Box .Column: https://599cd.com/acd15

RESOURCES:
FREE Customer Template Database: https://599cd.com/XCDT
FREE Access Level 1: https://599cd.com/Free101
$1 Access Level 2: https://599cd.com/1Dollar
Your Questions Answered: https://599cd.com/TechHelp
Learning Connection 50% OFF: https://599cd.com/Connection
Survey: https://599cd.com/survey

Richard's Blog: https://599cd.com/blog
Access Forum: https://599cd.com/AccessForum
Twitter: https://twitter.com/LearningAccess

Email Me: amicron@gmail.com

https://en.wikipedia.org/wiki/Microsoft_Access
https://products.office.com/en-us/access
https://microsoft.com/en-us/microsoft-365/blog/access/

KEYWORDS:
For Next Statement
For Next Loops in Microsoft Access VBA
Count Occurrences of a Character in a String
Count specific character in a string
count the occurrences of a character
Match Parentheses
Match Brackets
Rich Text in Long Text Fields
Add HTML Codes and Color to Text Boxes
Change Font Color in Text Box

QUESTIONS:
Ask your questions below, please!

 

Glossary Chr and Asc Link 
Alex Hedley    
2 months ago
http://599cd.com/glossary/access/chr/

http://599cd.com/glossary/access/asc/
Add a Reply

Post a New Comment or Question
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 
 
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search The Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

YouTube Channel    LinkedIn

Blog RSS Feed   
Keywords: TechHelp Access for next for loops count occurrences of a character in a string match parentheses match brackets rich text html colors   PermaLink