Hi All!
I was in a car accident and laid up for quite a while so I'm just getting back in.
I inherited a databae from a developer (since gone) and there are a lot of tables where a single field contains a first name,a space, and last name and then others which are in 2 fields. I know this is not cool but there is so much of it. As example, there is a table named tblContacts which has 3 fields, ContactID, FirstName, LastName. He was trying to find duplicite records and had this SQL. I think he was working on a part where the strContactName was like "joe smith".
He had it setup like this:
strSQL = "SELECT ContactID, FirstName & " " & LastName AS rsContactName FROM tblContacts Where rsContactName = '" & strContactName & "'"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
rs.FindFirst "[rsContactName] = '" & sContactName & "'"
He said he didnt get errors but it didnt run, just stayed on the first record. I've look all over, trieed different search strings, etc., but nothing quite like this. Any ideas why it wont run? Thanks in advance.
I was in a car accident and laid up for quite a while so I'm just getting back in.
I inherited a databae from a developer (since gone) and there are a lot of tables where a single field contains a first name,a space, and last name and then others which are in 2 fields. I know this is not cool but there is so much of it. As example, there is a table named tblContacts which has 3 fields, ContactID, FirstName, LastName. He was trying to find duplicite records and had this SQL. I think he was working on a part where the strContactName was like "joe smith".
He had it setup like this:
strSQL = "SELECT ContactID, FirstName & " " & LastName AS rsContactName FROM tblContacts Where rsContactName = '" & strContactName & "'"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
rs.FindFirst "[rsContactName] = '" & sContactName & "'"
He said he didnt get errors but it didnt run, just stayed on the first record. I've look all over, trieed different search strings, etc., but nothing quite like this. Any ideas why it wont run? Thanks in advance.