Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    interactive report footer (access 97)

    Hi, i need to split a report into groups and have an object in the group footer change its value according to the group that it is in.
    The database holds staff records, staff are in different departments, each member of staff may or may not work on a certain contract.
    The departments are defined by a department name, the contract is simply a yes/no field.
    My report needs to group staff by department but within each department i want to have subtotals of staff on and staff off the contract.
    How do i get the contract group footer to change its content between "on contract " & value and "off contract & value ???
    can this be done in the text object control source or do i need to use vb ? <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23> <img src=/S/flee.gif border=0 alt=flee width=25 height=25>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: interactive report footer (access 97)

    You need to group within department on your yes/no field, which would allow you to put the formula in the group footer instead of the department footer. Then instead of a label, use a textbox. Make your controlsource a formula like "=IIf(condition1=True,"on contract","off contract")". I leave it to you to fill in the appropriate replacement for condition1.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: interactive report footer (access 97)

    charlotte, what would the syntax be to check the value of a yes/no object?
    something like iif(IAG=-1,"on contract","off contract")?

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: interactive report footer (access 97)

    That will work, or you can use the built-in constant True. Oh, I'd put brackets around the control/field name though so Access knows it isn't a variable.
    Charlotte

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: interactive report footer (access 97)

    Where does the Yes/No control need to be in the report for the iif statement to find it ?

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: interactive report footer (access 97)

    It should be in either the group header or the detail. Play with it,
    Charlotte

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: interactive report footer (access 97)

    OK, I hold my hands up to being the stupid one in class.
    I dropped the text box on the report and the label landed with it by default. I changed the label to read the contract name and then editted the text box with the iif statement.
    (have you spotted it yet ?)
    Yep, the text box was changing but not big enough to show the change in the report and the label was static (as you would expect) and I assumed that the text box was not working. Please shoot me now ! <img src=/S/bash.gif border=0 alt=bash width=35 height=39> <img src=/S/beep.gif border=0 alt=beep width=15 height=15> <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: interactive report footer (access 97)

    Don't feel bad, we all trip over these things occasionally, not matter how long we've been doing this.
    Charlotte

Posting Permissions

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