Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    233

    Unanswered: setting the value of a textbox in a report using iif in data source

    I want my text box to have the value 0 if 1 condition and the value of a field in the datasource if another value is selected on a form that loads it
    i tried making this the datasource, but when i go to print preview it goes right back to design view. can anyone give help thanks


    IIf(Eval("[forms]![frmReports]![Date]") = 1, 0, SumOfProceeds)

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    This should work...
    Code:
    Iif(Me.myTextBox.Value=1, 0, Me.myTextBox.Value)
    'OR
    Iif(Me.myTextBox.Value="1", "0", Me.myTextBox.Value)
    On a bound datasource
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Or using his references:

    Code:
    IIf([forms]![frmReports]![Date] = 1, 0, SumOfProceeds)
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I cut up his food, you spoonfed
    George
    Home | Blog

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Could always do the "chew and regurgitate" thing ^^
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Touché
    George
    Home | Blog

Posting Permissions

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