Consulting

Results 1 to 4 of 4

Thread: Solved: Access Reports (Its me again)

  1. #1
    VBAX Regular
    Joined
    Mar 2005
    Posts
    67
    Location

    Solved: Access Reports (Its me again)

    Hey guys.
    Its me again. I just need to finish this project asap and keep stumbling on weird problems. I think this my last question.
    When im generating a report, i know the event Detail_Format gets fired after every record.
    I have in my report a label and a bound textbox.
    The label says "Cell phone"
    The textbox is bound to a cell phone field.

    I need to implement a mechanism in Detail_Format that will, for every record, check if there is a phone number if the Cell phone field in the database, and if there is no cell phone number i need to hide the "Cell phone" label. This has to be done on every record. So basically, it would display:

    Cell phone
    (999)999-9999

    if there was a cell phone in the database for this record and would display nothing if there wasnt.
    I know you cant change the text of labels on reports, you can only change what they are bound to, when the report is loading. Its not like with forms.
    I think i need to use an IIF statement on that field, but yet again Im stuck because you cant change the text.

    Could anyone point me in the right direction ?

    Thank you
    Mike

  2. #2
    BoardCoder VBAX Regular
    Joined
    May 2004
    Location
    Istanbul, Turkiye
    Posts
    73
    Hi Mike,

    Say your cell phone field name is "cellPhone".

    Convert the "Cell Phone" label to Text (right click on label and Change to->Textbox) and set its Control Source by using following function:

    =IIf([cellPhone]="","","Cell Phone")

    This way, it will work by records and show empty string if cellPhone is empty.

    I hope it helps.
    Suat

  3. #3
    VBAX Regular
    Joined
    Mar 2005
    Posts
    67
    Location
    Awesome. Works like magic.


    Thanx

  4. #4
    BoardCoder VBAX Regular
    Joined
    May 2004
    Location
    Istanbul, Turkiye
    Posts
    73
    Glad to hear it helps!
    Suat

Posting Permissions

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