Error with Trim function (1 Viewer)

ChristyG

New member
Local time
Today, 07:13
Joined
Nov 1, 2005
Messages
7
I have used the Trim function in a query and am getting an error. At first I was concatanating several fields but have cut it back to the most basic form but still receive the error. The error says that the trim expression failed. Here is the code I used:

fullname: trim([last]) + ", " + trim([first]) + " " + trim([middle])

I then used
fullname: trim([last])

I got the same error. Just using the field last does not generate an error.

Any ideas? I created the DB in Access XP and am getting the error in 2003. I tried the changes in 2003 but still got the error.

thanks. :)
 

Sammy B

Registered User.
Local time
Today, 07:13
Joined
Oct 31, 2005
Messages
97
The actual syntax is:
fullname: trim([last]) & ", " & trim([first]) & " " & trim([middle])

Hope this helps

Sam
 

ChristyG

New member
Local time
Today, 07:13
Joined
Nov 1, 2005
Messages
7
Thanks for the info, but it didn't fix the error I'm getting. Same results as when I used the + instead of the &. The error message says: Undefined function 'Trim' in expression.

Anyone have any other ideas?
 

neileg

AWF VIP
Local time
Today, 14:13
Joined
Dec 4, 2002
Messages
5,975
Looks like a missing references problem. Open a module window (a new one if you have no modules). Under Tools, select References and look for any that say Missing.
 

Users who are viewing this thread

Top Bottom