Results 1 to 2 of 2
  1. #1
    Battlescar is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    18

    Help with an exppression in a text box record source


    Is there something I am doing wrong with this expression? I keep getting an error. It is writing in a text box record source on a form.
    The data is coming from an query.

    =Count(IIf([FiscalYear]=[cboFY].[column](0),0)+IIf([FY]="D",0)+IIf([FundingStatus]="P",0)+IIf([kick off date]=[cboFY].[column](4),0))+Count(IIf([FiscalYear]=[cboFY].[column](3),0)+IIf([FY]="D",0)+IIf([FundingStatus]="P",0)+IIf([kick off date]=[cboFY].[column](0),0))

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    - First, you cannot add numbers and letters
    Code:
    IIf([FiscalYear]=[cboFY].[column](0),0)+IIf([FY]="D",0)
    I suspect you're trying to concatenate, in which case the operator is the concatenation one (&), not the addition one (+). Saying this because it appears some fields are numeric and some are alpha.
    - Not sure why you're using Count. If every IIF returned false, you'd sum a bunch of zeros, so what's to count?
    - [] usually denotes a field. I would not use it with the Column property of a combo box.
    Aside from those, my usual advice would be to always include the error message and/or number as per my signature below. Otherwise, we're just guessing.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 20
    Last Post: 03-16-2017, 08:36 AM
  2. Text Box Control Source
    By ajs112 in forum Forms
    Replies: 1
    Last Post: 09-15-2014, 10:39 AM
  3. Replies: 5
    Last Post: 09-18-2013, 09:15 PM
  4. Replies: 14
    Last Post: 05-25-2012, 02:40 AM
  5. Replies: 2
    Last Post: 03-01-2012, 12:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums