String
Using the STRING Function
In this tutorial you will learn how to use the String Function.
The String function returns a character repeated a given number of times.
=String( Number As Long, Character )
Number Amout of characters you want to add
Character value you wish to add
In this example we will use the Underscore ("_") character to add to a string.
We wish to add it 4 times.
The result is "____".
Query
The results using a Query would be
SELECT STRING(4, "_");
FORM
In a Form you could set the Default Value of a Textbox to
=STRING(4, "_")
VBA
In a Form add a TEXTBOX control and rename it "txtStrComp", then you could add the following in the Load Event.
Private Sub Form_Load()
txtSTRING = STRING(4, "_")
End Sub
Courses
Access Expert 25
Search
You can find more about this by searching the website.
By: Alex Hedley
Click here to sign up for more FREE tips
|