Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Apr 2002
    Location
    Bloomsburg, Pennsylvania
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    bracketing of field name in query (Access 2002)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: bracketing of field name in query (Access 2002)

    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.

  3. #3
    Lounger
    Join Date
    Apr 2002
    Location
    Bloomsburg, Pennsylvania
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: bracketing of field name in query (Access 2002)

    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!

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: bracketing of field name in query (Access 2002)

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

Posting Permissions

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