Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Concatenate (Access 2000)

    Could you help me built correctly the foolowing concatnated code,since it doesn work :

    Annual output :" & " =DLookUp("SumOfLiters";"qryLitersPerCustomer";"Cus tomerID=" & [CustomerID]) " & " liters

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

    Re: Concatenate (Access 2000)

    You must enclose static text in quotes. Operators such as & and variable expressions must not be enclosed in quotes. Does this work?

    ="Annual output : " & DLookUp("SumOfLiters";"qryLitersPerCustomer";"Cust omerID=" & [CustomerID]) & " liters"

    "Annual output: " is static, and " liters" is static too. The part in between is variable.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Concatenate (Access 2000)

    Yes, it works super!!! Is it possible to make the control invisible in case there are no liters ?

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

    Re: Concatenate (Access 2000)

    If you want to hide the control if SumOfLiters is missing or 0, you can add the following line to the On Current event procedure of the form:

    Me.txtLiters.Visible = (Nz(DLookUp("SumOfLiters", "qryLitersPerCustomer", "CustomerID=" & [CustomerID]), 0) > 0)

    where txtLiters is the name of the text box displaying the annual output.

Posting Permissions

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