name (1 Viewer)

amavadia

Registered User.
Local time
Today, 10:17
Joined
Mar 30, 2006
Messages
36
I have a form to input details on an artist into a table. however ive just found a fault:
i have split the name up into first name and surname
and some artists only use one name e.g. Mario

is there any way i can get the form to check if there is anything inputted into the surname field of the form after the names have been entered and if not, then to move the data from the first name to the surname because all the searching in the system works on the surname.

its too late to combine the two fields btw!
 

KeithG

AWF VIP
Local time
Today, 02:17
Joined
Mar 23, 2006
Messages
2,592
Sure, you can use the forms Close event to check to see if the text box is null. Then if it is you can assign the value from the firstname text box to the surname text box. Something like below should work


if IsNull(me.txtSurname)=True then
me.txtSurname=me.txtFirstName
End if




txtSurname=Name of your Surname text box
txtFirstName=Name of your FirstName text box
 

statsman

Active member
Local time
Today, 05:17
Joined
Aug 22, 2004
Messages
2,088
You could do one of the following:

All of the artists with only one name would have a surname of "X", then just tell your forms, queries and reports to ignore the "X". This will work fine until you get an artist with the last name of Xavier. You would also have to change the search parameters to first. Again this would work fine until you had two artists named George.

OR

You can combine the two names using an update query. Create a new field in the table called Name then in the update query:

Name: ([first]&" "&[last])

Keep first and last in your table and continue to enter data with the first and last name. You would have to re-run the update query everytime you entered new data. As long as you don't repeat artists change the search parameter to Name.

Thats as far as my thinking takes me.
 

statsman

Active member
Local time
Today, 05:17
Joined
Aug 22, 2004
Messages
2,088
Believe it or not, Keith and I posted at exactly the same time. His solution is much better
 

Users who are viewing this thread

Top Bottom