Help Building Search....

R

RBear3

Okay, I downloaded the Issue database template and simplified it greatly.

Now, I can't get the "search issues" form to work.

I have the following controls on my search form:
Application (dropdown list)
TextSearch (text field)


I'd like to modify the existing code so that when I make an entry and click
the "search" button, it will make the form footer visible (where the
"browse_all_issues" form is imbedded as a subform). That part works. But,
the next lines set the filter and turn it on...
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height

The previous part of my code builds the filter. Here is where I can't get
it to work. How do I tell it to take my "strWhere" and add to it to create
a filter that will do the following:

Only pull up records where the Application is eqaul to my selected
application. AND Pull up records where the Title, Question, OR Answer
include my textsearch entry?

When I try to simply build the application, I get an error (Run-time
error '438': Object doesn't support this property or method) When I debug,
it is highlighting my line that says...
If Nz(Me.Application) <> "" Then


Here is the actual code I have...

Private Sub Search_Click()
Dim strWhere As String

strWhere = "1=1"

' If Category
If Nz(Me.Application) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "Issues.Application = '" &
Me.Application & "'"
End If

'DoCmd.OpenForm "Browse Issues", acFormDS, , strWhere, acFormEdit,
acWindowNormal
If Not Me.FormFooter.Visible Then
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height
End If
Me.Browse_All_Issues.Form.Filter = strWhere
Me.Browse_All_Issues.Form.FilterOn = True




Any suggestions?

--
Thanks!!

RBear3
..



..
 
B

Beetle

The word "Application" is a reserved word in Access and should not be used as
the name of a field or control. That's probably why you're getting an error
on that line. Change the name of the control (something like txtApplication,
for example if it is a text box) and see if that solves your error message.

For more "reserved" words, see this link;

http://support.microsoft.com/kb/209187

HTH
 

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