Access 2007-2016
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 
Glossary

New Entries Added Almost Daily!
Click here to get on our Mailing List

   

   Access    Excel    Word    Windows    HTML

 
MS Access

Split

Using the SPLIT Function

In this tutorial you will learn how to use the Split Function.

The Split Function returns a zero-based, one-dimensional array containing a specified number of substrings.

=Split(Expression As String, [Delimiter], [Limit As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare])

string Required. String expression containing substrings and delimiters. If expression is a zero-length string(""), Split returns an empty array, that is, an array with no elements and no data..
[Delimiter] Optional. String character used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If delimiter is a zero-length string, a single-element array containing the entire expression string is returned..
[Limit] Optional. Number of substrings to be returned; –1 indicates that all substrings are returned..
[Compare] Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values..

In this example we will work with is "Alex,Jon,Rick".

Split - Function Engine

The result is "Alex" "Jon" "Rick".

This will keep any spaces surrounding the names, so you could use the Trim function to get rid of these.

The Settings are:

Compare
ConstantValueDescription
vbUseCompareOption-1Performs a comparison using the setting of the Option Compare statement.
vbBinaryCompare0Performs a binary comparison.
vbTextCompare1Performs a textual comparison.
vbDatabaseCompare2Performs a comparison based on information in your database. (Microsoft Office Access 2007 only.)

FORM

In a Form you could set the Default Value of a Textbox to

	=Split("Alex,Jon,Rick", ",")
	
VBA

In a Form add a TEXTBOX control and rename it "txtSplit", then you could add the following in the Load Event.

	Private Sub Form_Load()
		txtSplit = Split("Alex,Jon,Rick", ",")
	End Sub
	

Course

Want to learn more? Request this via the contact form.

Search

You can find more about this by searching the website.


Alex Hedley (Avatar) By: Alex Hedley


Click here to sign up for more FREE tips

 

You may want to read these articles from the 599CD News:

 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About Us
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP