J
Jill
I have a button in a form that will ask for a keyword,
store it in strFilter and use it to generate a report,
the code as as following (grpField is a option group with
checkboxes ranging from 1 to 6)
------------------------------------
Private Sub CmdPreview_Click()
Dim strFilter As String
If Not IsNull(Me.txtWot2Find) Then
Select Case Me.grpField
Case 1
If IsNumeric(Me.txtWot2Find) Then
strFilter = "Project No = " & Me.txtWot2Find
Else
MsgBox "Invalid Project No."
End If
Case 2
strFilter = "Project Title Like ""*" &
Me.txtWot2Find & "*"""
Case 3
strFilter = "Company Like ""*" & Me.txtWot2Find
& "*"""
Case 4
strFilter = "Drawing Title Like ""*" &
Me.txtWot2Find & "*"""
Case 5
strFilter = "Revision Like ""*" & Me.txtWot2Find
& "*"""
Case 6
If IsNumeric(Me.txtWot2Find) Then
strFilter = "Box No = " & Me.txtWot2Find
Else
MsgBox "Invalid Box No."
End If
End Select
DoCmd.OpenReport "FR", acViewPreview, ,
strFilter
End If
End Sub
----------------------
when i enter the keyword and submit it, i get the
following error:
"438: object doenst support this property or method" ...
and it stops on the line "Select Case Me.grpField", are
there any errors? Any help would be appreciated! thanks
Jill
store it in strFilter and use it to generate a report,
the code as as following (grpField is a option group with
checkboxes ranging from 1 to 6)
------------------------------------
Private Sub CmdPreview_Click()
Dim strFilter As String
If Not IsNull(Me.txtWot2Find) Then
Select Case Me.grpField
Case 1
If IsNumeric(Me.txtWot2Find) Then
strFilter = "Project No = " & Me.txtWot2Find
Else
MsgBox "Invalid Project No."
End If
Case 2
strFilter = "Project Title Like ""*" &
Me.txtWot2Find & "*"""
Case 3
strFilter = "Company Like ""*" & Me.txtWot2Find
& "*"""
Case 4
strFilter = "Drawing Title Like ""*" &
Me.txtWot2Find & "*"""
Case 5
strFilter = "Revision Like ""*" & Me.txtWot2Find
& "*"""
Case 6
If IsNumeric(Me.txtWot2Find) Then
strFilter = "Box No = " & Me.txtWot2Find
Else
MsgBox "Invalid Box No."
End If
End Select
DoCmd.OpenReport "FR", acViewPreview, ,
strFilter
End If
End Sub
----------------------
when i enter the keyword and submit it, i get the
following error:
"438: object doenst support this property or method" ...
and it stops on the line "Select Case Me.grpField", are
there any errors? Any help would be appreciated! thanks
Jill