Results 1 to 5 of 5

Thread: #Name? (2007)

  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Evansville, Indiana, USA
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    #Name? (2007)

    I have a query that has and expression called Expr1. I want this value to be displayed on a form that has the record source set to a different query. I have the record source of the a textbox on the form set to =[quSickTimeTot]![Expr1], but it shows up #Name?. What am I doing wrong? I know the expression works because if i look at the table view of quSickTime it shows the correct value.
    Thanks,

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: #Name? (2007)

    You need to use DLookup in the textbox's controlsource to get the value you want. At a minimum, it would be something like this:

    =DLookup("Expr1", "quSickTime")

    However, if that is all you use, you will get the value of Expr1 in the first record returned by the query. You probably will need to add a Where clause to the DLookup.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Evansville, Indiana, USA
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: #Name? (2007)

    I get an error that says "The expression you entered has an invalid string." Do I need to have brackets somewhere? It is alright if it only returns the first record from the query.
    thanks,

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: #Name? (2007)

    I don't know what you enterred and where, so I can't guess what could be wrong. Also, can you run your query stand-alone from db window, just to see if it works?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Evansville, Indiana, USA
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: #Name? (2007)

    It works now... I mispelled the query name.

Posting Permissions

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