Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2008
    Posts
    59

    Unanswered: Invalid Bracketing of Name

    I am having some big problems with this 'Invalid Bracketing of Name' error. I have looked on this forums and others for suggestions but everything suggested has not helped. Does anyone else have any ideas to resolve this?

    Basically, I get the error on the line [Forms!fmnuReportSelect.cboSrvID] in this query:

    PARAMETERS [[Forms]!fmnuReportSelect.[cboSrvID]] Long;
    TRANSFORM Count(tblResponses.Rspns) AS CountOfRspns
    SELECT tblSrvRspns.URN, tblQuestions.QstnID, tblQuestions.QstnLvl1, tblQuestions.QstnLvl2, tblQuestions.QstnLvl3, tblQuestions.QstnText, tblResponses.Rspns, tblQuestions.SrvID
    FROM tblSrvRspns INNER JOIN (tblQuestions INNER JOIN tblResponses ON tblQuestions.QstnID = tblResponses.QstnID) ON tblSrvRspns.RspnsID = tblResponses.RspnsID
    WHERE (((tblQuestions.SrvID)=Forms!fmnuReportSelect.cboS rvID) AND ((tblResponses.RspnsID) Like [Forms]![fmnuReportSelect]![cboRespondant]))
    GROUP BY tblSrvRspns.URN, tblQuestions.QstnID, tblQuestions.QstnLvl1, tblQuestions.QstnLvl2, tblQuestions.QstnLvl3, tblQuestions.QstnText, tblResponses.Rspns, tblQuestions.SrvID
    PIVOT "Number of Responses" In ("Number of Responses");

    This line appears twice but it seems to be the first one that is causing the problems. Whenever I go back into the query it has defaulted to this:

    PARAMETERS [[Forms]!fmnuReportSelect.[cboSrvID]] Long;

    I have tried changing the line to all of these:
    Forms!fmnuReportSelect.cboSrvID
    Forms!fmnuReportSelect!cboSrvID
    Forms.fmnuReportSelect.cboSrvID
    Forms("fmnuReportSelect").cboSrvID

    But had no luck. Does anyone have any other suggestions? I will be extremely grateful!

    Russ

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Not sure if this is a typo, but there is a space in cboS rvID in the line WHERE (((tblQuestions.SrvID)=Forms!fmnuReportSelect.cboS rvID that could be causing the problem.

  3. #3
    Join Date
    Nov 2008
    Posts
    59
    That is a typo yeah. My laptop sometimes gets a little spaced out so it's quite possible it added the space there during a bad spell. However, there is definately no space in the actual SQL.

    If anyone has any other suggestions please let me know! Please!

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    These are both syntactically correct:

    Forms!fmnuReportSelect!cboSrvID
    Forms("fmnuReportSelect")!cboSrvID


    Don't forget to do ALL of them, including Forms!fmnuReportSelect.cboS.

    I also don't like the look of the double square brackets:

    PARAMETERS [[Forms]!fmnuReportSelect.[cboSrvID]] Long;

    I'd try changing it to this as well:

    PARAMETERS Forms!fmnuReportSelect!cboSrvID Long

    And see what happens then? I don't write a lot of SQL manually, I generally let Access do it wherever I can, so forgive me if this doesn't help at all.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Nov 2008
    Posts
    59
    That's done it!

    I had tried changing them around to see what works but must not have had one point where all of them had the same format. Now that I have made sure they all have the same style, i.e. Forms!fmnuReportSelect!cboSrvID, they work perfectly and are not reverting back to the horrible square brackets.

    Cheers!

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Great!!
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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