• bracketing of field name in query (Access 2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » bracketing of field name in query (Access 2002)

    Author
    Topic
    #386231

    I’m getting a strange error. I have a query that uses the field on a form in the criteria line. The query works fine when I first go into it. I can preview the data and all is well. But if I modify the query in any way, even just picking an additional field out of one of the tables, then I get this error: “Invalid bracketing of name ‘[forms!frmBldg!time_frame_id]’.

    The criteria line actually looks like this: [forms]![frmBldg]![time_frame_id]

    Can anyone see a problem? This same field is also defined in the parameters in the same format.
    The database was originally opening in Access 2000 format, so I converted it to 2002 to make sure that wasn’t causing a problem. I don’t really know what else to check. This is something that I use quite often and have never had a problem with it.

    Thanks for your help!
    Frances Donahoe

    Viewing 0 reply threads
    Author
    Replies
    • #669325

      Certainly seems strange. Does the problem persist if you quit Access and start it again?
      Perhaps, there is some kind of corruption. Try deleting [forms]![frmBldg]![time_frame_id] entirely and typing it in again. If that doesn’t help, try recreating the entire query from scratch.

      • #669344

        It didn’t help shutting down or retyping on the criteria line, but I retyped the values in the parameters window also and that corrected the problem. Thanks for your help!

        • #670272

          You’ll find that Access 2002 is very picky about forms references in its parameters. You absolutely MUST use square brackets around the parts of the reference or Access will kindly put a pair of square brackets around the entire expression, which is invariably wrong. If you leave out a pair of brackets (for example, when referencing a column of a combobox), it will put square brackets around the entire expression as well. This can bite you if you convert a query from an earlier version of Access where the query engine wasn’t as fussy.

    Viewing 0 reply threads
    Reply To: bracketing of field name in query (Access 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: