Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006

    Unanswered: DLookUp in Label Caption

    I have a label on many forms and reports. Originally each was hard-coded text with the name of the organization "First Church Music List". To port the db for use by other organizations, I've created a table tParameters and with 2 text fields ParameterName and ParameterValue. qParameters is an alpha sort of it. At present the table has one entry:
    ParameterName ParameterValue
    OrganizationName "First Church" (without quotes).

    I entered the following in the caption property line of the label:
    =DLookup("[ParameterValue]","qParameters", "[ParameterName]='OrganizationName'") & " Music List"

    The form merely displays the line as typed. Removing the & " Music list" doesn't help. Is there a restriction on using dlookup in the caption property? What have I done wrong or what is the best way to accomplish this.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    set the caption property for the label control in the forms on open event

    or set the caption property for each form in the forms on load event
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2006
    Thanks, it works. Now, for the technically curious answer two questions.
    1. Why can't we just put that formula in the caption property directly in design view?
    2. You used On Open in the first suggestion; On Load in the second. Why?
    With many thanks as usual,
    Pete Townsend

  4. #4
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Quote Originally Posted by Pete Townsend View Post

    ...Why can't we just put that formula in the caption property directly in design view...
    The Access gnomes expect a Caption to be a String, and treat anything placed there as such.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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