I have a function in Access 2000 That Allows the user to type in a search string based on last name, First name or any portion of each Such as
Smi,Joh or Smith,J or Smith,John
It then builds an SQL Statment and runs the Query Displaying the results so the user can select the person they are looking for. If I open a new query and plug the generated SQL into it and run the query I get the expected results. If I run the exact same query in VBA using ADO I get no results. I don't understand why the query would work in 1 place and not in another.
SELECT qry_get_members.SBSB_ID as mbrid, qry_get_members.SBSB_LAST_NAME, qry_get_members.SBSB_First_NAME, qry_get_members.SBSB_MID_INIT, dbo_CMCV_MEME_BASE.MEME_BIRTH_DT as DOB FROM qry_get_members Where UCase(qry_get_members.SBSB_LAST_NAME) Like "SMI*" AND UCase(qry_get_members.SBSB_FIRST_NAME) Like "J*" Order By qry_get_members.sbsb_last_name, qry_get_members.sbsb_first_name
qry_get_members is a query to get a unique table of current members.
Any help is appreciated
Smi,Joh or Smith,J or Smith,John
It then builds an SQL Statment and runs the Query Displaying the results so the user can select the person they are looking for. If I open a new query and plug the generated SQL into it and run the query I get the expected results. If I run the exact same query in VBA using ADO I get no results. I don't understand why the query would work in 1 place and not in another.
SELECT qry_get_members.SBSB_ID as mbrid, qry_get_members.SBSB_LAST_NAME, qry_get_members.SBSB_First_NAME, qry_get_members.SBSB_MID_INIT, dbo_CMCV_MEME_BASE.MEME_BIRTH_DT as DOB FROM qry_get_members Where UCase(qry_get_members.SBSB_LAST_NAME) Like "SMI*" AND UCase(qry_get_members.SBSB_FIRST_NAME) Like "J*" Order By qry_get_members.sbsb_last_name, qry_get_members.sbsb_first_name
qry_get_members is a query to get a unique table of current members.
Any help is appreciated