If you just want to search on one field (but be able to choose which one),
you can implement this with copy'n'paste (i.e. without having to write any
new code):
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html
If you want to give the user the option to enter multiple criteria, this one
demonstrates how to write the filtering code for the specific fields you
need:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html
Once you have the form filtered correctly, you can then use the form's
Filter in the WhereCondition of OpenReport. The "Trouble-shooting and
Extending" section in the last link above discusses that.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Is it possible to do the following in MS Access and if it is please
> outline
[quoted text clipped - 13 lines]
> can't
> seem to put it all together.
Prohock - 07 Nov 2007 07:01 GMT
Hi Allen
I have created a form that provides the parameter to the query that
functions very well, however this is what happens when I hit the submit
button on my form. After entering the search criteria in the form, and
hitting enter, the parameter value window opens and the words that are typed
in the form are displayed above the entry box in the parameter value pop up
window. If I enter the search criteria again in the parameter value box the
query runs perfect.
How can I prevent the parameter value window from opening and having to
enter the search criteria twice?
> If you just want to search on one field (but be able to choose which one),
> you can implement this with copy'n'paste (i.e. without having to write any
[quoted text clipped - 31 lines]
> > can't
> > seem to put it all together.
Allen Browne - 07 Nov 2007 10:27 GMT
Acces pops up the parameter window if it cannot resolve the name.
For example, you may have misspelled the name, or the form may not be open.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hi Allen
>
[quoted text clipped - 55 lines]
>> > can't
>> > seem to put it all together.
Prohock - 10 Nov 2007 18:05 GMT
Hi Allen
Thanks for helping me along the way, I feel that I am very close to working
this out.
Is it possible to have the user enter a first or last name in a single
unbound textbox on a form and run a query that will pull up all records
matching either the first or last name entered?
This is what I have so far, it only works when the last name is entered.
VBA
Private Sub cmdFilter_Click()
Dim strWhere As String
If Not IsNull(Me.txtFilterMainName) Then
strWhere = Me.txtFilterMainName
strWhere = "([FirstName] Like ""*" & Me.txtFilterMainName & "*"") or "
End If
If Not IsNull(Me.txtFilterMainName) Then
strWhere = Me.txtFilterMainName
strWhere = "([LastName] Like ""*" & Me.txtFilterMainName & "*"") "
End If
Me.Filter = strWhere
Me.FilterOn = True
End Sub
query SQL
SELECT qryRecordSource.StudentID, qryRecordSource.FirstName,
qryRecordSource.LastName, qryRecordSource.CurrentGrade
FROM qryRecordSource
GROUP BY qryRecordSource.StudentID, qryRecordSource.FirstName,
qryRecordSource.LastName, qryRecordSource.CurrentGrade
HAVING (((qryRecordSource.FirstName) Like "*" &
Forms!StudentReport!txtFilterMainName & "*") Or ((qryRecordSource.LastName)
Like "*" & Forms!StudentReport!txtFilterMainName & "*"));
> Acces pops up the parameter window if it cannot resolve the name.
>
[quoted text clipped - 59 lines]
> >> > can't
> >> > seem to put it all together.
Prohock - 10 Nov 2007 18:49 GMT
Allen, Answered my own question: I used
VBA
strWhere = "[FirstName] Like '*" & Me.txtFilterMainName & "*' Or " &
"[LastName] Like '*" & Me.txtFilterMainName & "*'"
and I was able to join them together and everything works just fine.
Thanks Again
> Hi Allen
>
[quoted text clipped - 97 lines]
> > >> > can't
> > >> > seem to put it all together.
Allen Browne - 10 Nov 2007 22:25 GMT
Great! You have it all sorted out.
If you are interested in combining filters from several unbound text boxes,
you might enjoy this example:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html
The sample database illustrates how to handle different field types, a date
range, etc.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Allen, Answered my own question: I used
>
[quoted text clipped - 132 lines]
>> > >> > can't
>> > >> > seem to put it all together.