Results 1 to 8 of 8
  1. #1
    fluffyvampirekitten is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    108

    Angry Report is unable to open in Design view

    I wanna edit the report but I'm unable to open it in a design view .
    The error that i see is:



    Run-time error '2186'
    This property isn's available in Design view.

    Code:
    Private Sub Data_Retrived()
    Dim DB As String
    Dim DataSource1, DataSource2 As String
    Dim C_SOURCE, c_Category, C_QUERYTYPE, c_FieldMatched As String
        DB = "CrossSystemData"
        
        c_Category = "='" & Forms!Frm_Verification.cbo_category & "'"
        
        
        If Forms!Frm_Verification.cbo_Type = "ALL" Then
            C_QUERYTYPE = "Is Not Null"
        Else
            C_QUERYTYPE = "='" & Forms!Frm_Verification.cbo_Type & "'"
        End If
        
        If Forms!Frm_Verification.cbo_FieldMatched = "ALL" Then
            c_FieldMatched = "Is Not Null"
        Else
            c_FieldMatched = "='" & Forms!Frm_Verification.cbo_FieldMatched & "'"
        End If
            
        If Forms!Frm_Verification.cbo_institution = "ALL" Then
            c_institution = "Is Not Null"
        Else
            c_institution = "like '" & Forms!Frm_Verification.cbo_institution & "*'"
        End If
          
        DataSource1 = "SELECT * FROM " & DB & " WHERE C_TYPE = 'CROSS' AND " & _
                     " Category " & c_Category & " and Query_Type " & C_QUERYTYPE & _
                     " and FieldMatched " & c_FieldMatched & " and Institution " & c_institution & _
                     " ORDER BY FieldMatched, Group_No, Query_Type"
                     
        RecordSource = DataSource1
    End Sub

    This is highlighted when i clicked on "Debug" button. I can't figure out what's wrong with this line
    Could anyone help me ?
    Thanks in advance!

    Code:
    c_Category = "='" & Forms!Frm_Verification.cbo_category & "'"

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It's a shot in the dark, but the variable isn't declared as a string. Try

    Dim C_SOURCE As String, c_Category As String, C_QUERYTYPE As String, c_FieldMatched As String
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    fluffyvampirekitten is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    108
    Quote Originally Posted by pbaldy View Post
    It's a shot in the dark, but the variable isn't declared as a string. Try

    Dim C_SOURCE As String, c_Category As String, C_QUERYTYPE As String, c_FieldMatched As String
    Now there's a different error

    Run-time error '2450'

    Patient Unit cannot find the referenced form 'Frm_Verification'

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I suppose that's progress. Is that form open? Spelled correctly?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    fluffyvampirekitten is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    108
    Quote Originally Posted by pbaldy View Post
    I suppose that's progress. Is that form open? Spelled correctly?
    Yep, its open. Because i placed the button there (Export to excel) and yes, its spelled correctly .

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You can try this to make sure the SQL is right:

    http://www.baldyweb.com/ImmediateWindow.htm

    can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    fluffyvampirekitten is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    108
    Quote Originally Posted by pbaldy View Post
    You can try this to make sure the SQL is right:

    http://www.baldyweb.com/ImmediateWindow.htm

    can you post the db here?

    I can't post the db cos of the sensitive data

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Did th link help then?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Unable to edit report in design view
    By gdenham in forum Reports
    Replies: 1
    Last Post: 07-03-2014, 01:05 AM
  2. Replies: 7
    Last Post: 08-05-2013, 10:19 AM
  3. Unable to view query in design view
    By vemi007 in forum Queries
    Replies: 7
    Last Post: 01-19-2012, 11:36 AM
  4. Can't open database in design view.
    By mike96 in forum Access
    Replies: 13
    Last Post: 11-18-2011, 04:06 PM
  5. Form will not open View or Design
    By aldeb47 in forum Forms
    Replies: 2
    Last Post: 06-15-2011, 07:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums