Query ask two questions

R

Rod

Hello,

My query asks two questions sequentially. It does an "Or" to find the
result. How can I have both of the questions come up together so the user
can go directly to the field of interest, i.e. a single window with both
questions instead of two separate windows - the second after the enter key
pressed for the first? The user can use this query if he knows the name or
the phone number or both.

SELECT tblCandidates.CANDIDATE, tblCandidates.CALLED_ON,
tblCandidates.MANAGER, tblCandidates.DNC, tblCandidates.Confirmation_Msg,
tblCandidates.ID, tblCandidates.CALL_RESULTS, tblCandidates.SOURCE,
tblCandidates.FOLLOWUP_NUMBER, tblCandidates.Booked, [AREA_CODE] &
[INPUT_NUMBER] AS [NUMBER], tblCandidates.DATE_CONFIRMED,
tblCandidates.AREA_CODE, tblCandidates.CONFIRMATION_DATE, "1" & [NUMBER] AS
DIAL_NUMBER, tblCandidates.CORP_OVERVIEW, tblCandidates.RETURNED_CALL,
tblCandidates.COMMENTS, tblCandidates.PRIORITY, tblCandidates.ATTENDED,
tblCandidates.[NO_SHOW_FOLLOW-UP], tblCandidates.[CO RESULTS],
tblCandidates.[Follow-up_Needed], tblCandidates.IBA_DATE,
tblCandidates.[1st_Call], tblCandidates.[2nd_Call], tblCandidates.[3rd_Call],
tblCandidates.Last_Call, tblCandidates.Archive, tblCandidates.Num_of_Calls
FROM tblCandidates
WHERE (((tblCandidates.CANDIDATE) Like "*" & [Beginning of Candidate's Name]
& "*") AND ((tblCandidates.INPUT_NUMBER) Like [7 digit Phone Number] & "*")
AND ((tblCandidates.DNC)=False)) OR (((tblCandidates.CANDIDATE) Like "*" &
[Beginning of Candidate's Name] & "*") AND ((tblCandidates.DNC)=False) AND
((tblCandidates.FOLLOWUP_NUMBER) Like "*" & [7 digit Phone Number] & "*"))
ORDER BY tblCandidates.CALLED_ON DESC;
 
J

Jerry Whittle

Create an unbound form with two text windows. Also have a command button on
the form that runs the query. As a nice touch, make the form invisible. For
this to work the form must stay open, but can be invisible.

Then change [Beginning of Candidate's Name] in the query to
Forms![FormName]![TextBoxName]

Do something similar for the other field. Open the form when wanting to run
the query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top