PaulChilds
Technical User
- May 21, 2002
- 195
Hi,
I have a database to keep track of all my records and CDs.
To enter the names of all the Bands and singers I have a form in which there are three fields:
First Name
Surname
Full Name
The full name field is concatenated from the other two using the following code:
Private Sub First_Name_AfterUpdate()
Me![Full Name] = [First Name] & " " & [Surname]
End Sub
and
Private Sub Surname_AfterUpdate()
Me![Full Name] = [First Name] & " " & [Surname]
End Sub
This seemed to be working great UNTIL... I entered a 'one-name' artist (Sting, Dido etc).
The code then puts a space after the name (which I don't want). How can I set it so that if the surname field is empty, then not to display the space?
I though of deleting & " " & [Surname] from the First Name code, but then if I decide to go back and change it, it gets in a bit of a mess (and the space was still there any way).
Any thoughts?
CHeers
PC
I have a database to keep track of all my records and CDs.
To enter the names of all the Bands and singers I have a form in which there are three fields:
First Name
Surname
Full Name
The full name field is concatenated from the other two using the following code:
Private Sub First_Name_AfterUpdate()
Me![Full Name] = [First Name] & " " & [Surname]
End Sub
and
Private Sub Surname_AfterUpdate()
Me![Full Name] = [First Name] & " " & [Surname]
End Sub
This seemed to be working great UNTIL... I entered a 'one-name' artist (Sting, Dido etc).
The code then puts a space after the name (which I don't want). How can I set it so that if the surname field is empty, then not to display the space?
I though of deleting & " " & [Surname] from the First Name code, but then if I decide to go back and change it, it gets in a bit of a mess (and the space was still there any way).
Any thoughts?
CHeers
PC