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?
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?