D
DStrong
OK, so I am using Win XP, and running Access 2003. I have a 2003 database
downloaded from MS Office site called Issues DB.
I have added to this DB a group of tables for Root Cause Analysis. I have
set up a search just like the one for the Issues search and all works except
search by what I have called Record Owner. This is a first and last name of
the person who entered this in to the DB.
I have this macro copied from the Issues DB for a search:
Private Sub Search_Click()
Const cInvalidDateError As String = "You have entered an invalid date."
Dim strWhere As String
Dim strError As String
strWhere = "1=1"
' If Department
If Not IsNull(Me.Department) Then
'Create Predicate
strWhere = strWhere & " AND " & "[RCA Records].Department = " &
Me.Department & ""
End If
' If Record Owner
If Not IsNull(Me.[Record Owner]) Then
'Add the predicate
strWhere = strWhere & " AND " & "[RCA Records].[Record Owner] = " &
Me.[Record Owner] & ""
End If
' If Status
If Not IsNull(Me.Status) Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "[RCA Records].Status = '" &
Me.Status & "'"
End If
If strError <> "" Then
MsgBox strError
Else
'DoCmd.OpenForm "Browse RCAs", 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 RCA Events].Form.Filter = strWhere
Me.[Browse All RCA Events].Form.FilterOn = True
End If
End Sub
When I search my Record Owener I get a 'runtime error 2001, You Canceled the
Previous Operation'. When I debug the line
Me.[Browse All RCA Events].Form.Filter = strWhere
is highlighted. I have tried to change everything but I am overlooking
something somewhere. I have now looked at this so long that I know I cannot
find this and need a good set of eyes to find my error.
My form seems to be pulling the data correctly, I just can't find where I
have gone wrong.
If you need more info, please ask. I need to get this working ASAP.
downloaded from MS Office site called Issues DB.
I have added to this DB a group of tables for Root Cause Analysis. I have
set up a search just like the one for the Issues search and all works except
search by what I have called Record Owner. This is a first and last name of
the person who entered this in to the DB.
I have this macro copied from the Issues DB for a search:
Private Sub Search_Click()
Const cInvalidDateError As String = "You have entered an invalid date."
Dim strWhere As String
Dim strError As String
strWhere = "1=1"
' If Department
If Not IsNull(Me.Department) Then
'Create Predicate
strWhere = strWhere & " AND " & "[RCA Records].Department = " &
Me.Department & ""
End If
' If Record Owner
If Not IsNull(Me.[Record Owner]) Then
'Add the predicate
strWhere = strWhere & " AND " & "[RCA Records].[Record Owner] = " &
Me.[Record Owner] & ""
End If
' If Status
If Not IsNull(Me.Status) Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "[RCA Records].Status = '" &
Me.Status & "'"
End If
If strError <> "" Then
MsgBox strError
Else
'DoCmd.OpenForm "Browse RCAs", 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 RCA Events].Form.Filter = strWhere
Me.[Browse All RCA Events].Form.FilterOn = True
End If
End Sub
When I search my Record Owener I get a 'runtime error 2001, You Canceled the
Previous Operation'. When I debug the line
Me.[Browse All RCA Events].Form.Filter = strWhere
is highlighted. I have tried to change everything but I am overlooking
something somewhere. I have now looked at this so long that I know I cannot
find this and need a good set of eyes to find my error.
My form seems to be pulling the data correctly, I just can't find where I
have gone wrong.
If you need more info, please ask. I need to get this working ASAP.