RTrim function

TomKat

Registered User.
Local time
Today, 06:43
Joined
Apr 24, 2008
Messages
61
can this be put in the table or query? or is it only available to the form fields?
 
You can use it in a query, form, or report (also VBA code and macros).
 
Can you give me an example used in each... Query, Form field. Careless about the macro. Trying to stay away from that.

Use field "LastName"
 
In a form the syntax would be

RTrim(Me.LastName)

In a query, something like

TrimmedLastName: RTrim([LastName])

then use the Calculated Field named TrimmedLastName instead of the LastName field in forms or reports.

What exactly are you using this for? I ask because in Access, you seldom have trailing spaces, which is what RTrim() trims off, unless you've imported data from somewhere outside of Access or you've copied and pasted data from somewhere into Access.
 
There will be times I will import data from an excel spreadsheet and others, I have techs entering names that sometimes don't care how they type the names. Blank spaces, all upper, all lower, mixed. They can't seem to follow one simple rule of Proper naming with upper and lower case. Thus me having to put in the Rtrim and fixing the names with a convertstring module.
 
TrimmedLastName: RTrim([LastName])

Could that be added with another function in the same field in a query. Two functions in one field?
 
TrimmedLastName: RTrim([LastName])

Could that be added with another function in the same field in a query. Two functions in one field?

Yes, you can do multiple functions. For example:

TrimmedName:RTrim([LastName]) & ", " & RTrim([FirstName])
 
I see, if you are joining items you must use the & ", " &. I was trying the + and just the &.

Thanks
 
Boblarson: How about using a RTrim and something else on the same field in a query?
 
You can use more than one function against a field. What did you have in mind?
 
This Smartcase-Function: Smartcase([LastName]) with the Rtrim in a qeury field for the lastname.
 
Something like this:

Code:
NewNameField:Smartcase([color=red]RTrim([/color][LastName][color=red])[/color])
 

Users who are viewing this thread

Back
Top Bottom