Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50

    Unanswered: Text Box Field Referrals

    If I put the following code into the ControlSource of a Textbox, it returns "#Name?" when the form is run.

    =IIf(IsNull([RECORD]![CREATORUSER])," ","Created by: " & [RECORD]![CREATORUSER] & " on " & [RECORD]![DATECREATED])

    If I change the code to:

    =IIf(IsNull([CREATORUSER])," ","Created by: " & [CREATORUSER] & " on " & [DATECREATED])

    It works fine.


    I'm confused because the Expression Builder wrote the first one off of the fields I clicked on. Access built it ... why then doesn't Access recognize it?

    I ask the question because I want to refer to a field in another table in the expression. The field CREATORUSER is an employee number in Table1 and Table2 is the Employee Table that matches the employee number to the name. I want to display the name instead of the employee number.

    Thanks in advance.

    SD
    Thanks in advance or hope this helps.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    That's because when you use the ControlSource you're binding to the table the form is bound to ... Here's the problem: See that (!)? That is a form field token ... If instead you had: [RECORD].[CREATORUSER] assuming that [RECORD] was the name of a table/query ...

  3. #3
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    So when I change the "!" to a ".", why doesn't it work? "#Name?" is still there.
    Thanks in advance or hope this helps.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by reoterq
    So when I change the "!" to a ".", why doesn't it work? "#Name?" is still there.
    What table/query is the form bound to?

  5. #5
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    Originally posted by M Owen
    What table/query is the form bound to?
    The bound table is RECORD.
    Thanks in advance or hope this helps.

Posting Permissions

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