Query smiliar results

Djblois

Registered User.
Local time
Today, 06:53
Joined
Jan 26, 2009
Messages
598
I have made it super easy for my users to add New Carriers but now they are creating duplicates even though they have a combobox to see if it was added already. So what I want to do now is when they go to add a New Carrier, I want to Query for all results that are similar and ask them if they are sure it isn't one of the carrier's in the list. Is this possible? I looked at a Like operator and adding an asterick to the beginning and another at the end but what if the middle is just a little different? Is this possible to be done?

I have an idea how to do it but I don't know the SQL for it. Here is what I have started with:

Code:
SELECT [Carrier Table].Carrier
FROM [Carrier Table]
WHERE ((([Carrier Table].Carrier) Like [Forms]![frmSubAppts]![cobCarrier]))
ORDER BY [Carrier Table].Carrier;
now I want to add an asterick before the control and after the control
Also, I want a seperate test for First letter in the Control then Asterick then last letter in the control. I think this should help in most cases.

I even tested this:

Code:
SELECT [Carrier Table].Carrier
FROM [Carrier Table]
WHERE ((([Carrier Table].Carrier) Like ' * & [Forms]![frmAddNewCarrier]![tbCarrier] & *'))
ORDER BY [Carrier Table].Carrier;
and nothing shows up

and this:

Code:
SELECT [Carrier Table].Carrier
FROM [Carrier Table]
WHERE ((([Carrier Table].Carrier) Like '  [Forms]![frmAddNewCarrier]![tbCarrier] *'))
ORDER BY [Carrier Table].Carrier;
 
Last edited:
Code:
SELECT * FROM [Carrier Table]
WHERE [Carrier Table].Carrier LIKE '*' & [Forms]![frmAddNewCarrier]![tbCarrier] & '*'
 

Users who are viewing this thread

Back
Top Bottom