-
Trim
On my Contact Form, I have the following event procedure to create a "FullName" field in my Contact Table:
Private Sub Suffix_AfterUpdate()
[FullName] = [Title] & " " & [FirstName] & " " & [MI] & " " & [LastName] & " " & [Suffix]
End Sub
If I don't enter a middle initial, I get an extra space in my full name. I am trying to "trim" that field to eliminate the extra space with no luck. I either get the extra space or no space. Any suggestions would be greatly appreciated. I want the "FullName" field in my Contact Table instead of using the =Trim([FirstName] & " " & [MI] & " " & [LastName]) in a report because there are enough instances where we edit slightly the "FullName" field in the table.
Thanks for your time.
Julie
-
Julie,
Try:
[FullName] = Trim([Title] & " " & [FirstName] & " " & IIf(IsNull([MI]), "", [MI] & " ") & [LastName] & " " & [Suffix])
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules