This MSAccess tutorial explains how to use the Access Trim function with syntax and examples.
The Microsoft Access Trim function removes leading and trailing spaces from a string.
The syntax for the Trim function in MS Access is:
Trim ( text )
text is the string that you wish to remove spaces from.
The Trim function can be used in the following versions of Microsoft Access:
Let's look at how to use the Trim function in MS Access:
Trim (" Tech on the Net") Result: "Tech on the Net" Trim (" Alphabet ") Result: "Alphabet"
The Trim function can be used in VBA code in Microsoft Access.
Dim LResult As String LResult = Trim (" Alphabet ")
The variable LResult would now contain the value of "Alphabet".
You can also use the Trim function in a query in Microsoft Access.
In this query, we have used the Trim function as follows:
This query will remove leading and trailing spaces from the CategoryName field and display the results in a column called Expr1. You can replace Expr1 with a column name that is more meaningful.
The results would now be displayed in a column called TrimmedName.
(scroll to see more)