Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2012
    Posts
    1

    Unanswered: control source expression #name? error

    Hi everyone,
    I might have a very strange error with my access 2007-2010 edition.

    I created a form which has two fields, both textfields. One is filled with a datefield from the database. The name of the textfield is datefield. The name of the field from the database is date.

    The other textfield has an expression in its control source.
    When I first created this textfield and type in the control source =datefield (which is then changed to =[datefield]) and I 'run' it, everything goes ok. Also when I save it and run it again, all is ok.

    But when I restart my Access the second textfield has the error #Name? in it.

    (Of course I don't really want the second field to repeat the first, but I got this error as well and it turned out it also was given in the above mentioned simple example).

    Could someone please tell me what the problem is?

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    1 - Change the name of the field in the table from "date" to something else. "Date" is a reserved word, and using reserved words as variable names in Access is prohibited.

    2 - The name of the control on the form and the name of the field in the table are almost always the same. Because they aren't, in this case, is why you have grief from it when you have "=datefield," which is the control's name. You should have "= <the actual field name from the table>".

    3 - You can have umpteen controls on a form with the same field name, as long as the controls' names are different.

    Sam

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
  •