Professional Web Applications Themes

Form --> report problem - Microsoft Access

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

  1. #1

    Default Form --> report problem

    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
    Jill Guest

  2. #2

    Default RE: Form --> report problem

    Jill,

    Check to make sure the option group *really is* named
    grpField. Open the form in design mode, click on the frame
    around the option group and select properties. Click on
    the "Other" tab. What does the Name line show?

    Also, to keep from trying to open a report with no data,
    you might add:

    If Len(Trim(strFilter)) > 0 then
    DoCmd.OpenReport "FR", acViewPreview, , strFilter
    Else
    MsgBox "Invalid keyword. Please try again"
    Me.txtWot2Find = Null
    Me.txtWot2Find.SetFocus
    End If

    >-----Original Message-----
    >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
    >.
    >
    SteveS Guest

Similar Threads

  1. Replies: 3
    Last Post: May 9th, 01:55 PM
  2. report builder problem
    By zces in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: September 13th, 09:05 PM
  3. use form to enter report criteria
    By Mary in forum Microsoft Access
    Replies: 2
    Last Post: July 30th, 04:08 PM
  4. Replies: 1
    Last Post: July 10th, 06:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139