Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    72

    Unanswered: Only display image in report when one exists

    In Access 2003 I've got a Report "New_Additions" with new books added to the library catalogue (My Access DB).

    Relatively few books have an accompanying cover image so I want my new book report to show this when available but not leave a huge gap of white space when it's not.

    I gave the field [Image Link] in my query "New_Additions" the criteria "Is not null" which gives me the report of only those records with images. This isn't quite what I want as I still want the other records to show but not with the [Image Link] field if it's empty.

    I'm not able to formulate what I should be asking, so please help me in figuring out:
    1. Is it in the Query or the Report that I should be working
    2. What criteria do I need to add to do this.

    I've read some related information but it just isn't clear to me.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    alternatively test if the image exists using code in the reports on detail format event and set the visibility of the image control appropriately.

    you should also be able to test if the image link is valid and take appropriate action.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jul 2007
    Posts
    72
    Okay, I understand what you are saying (big advance for me) but I don't know what I would write to test whether there is an image.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Id expect to see something like
    If ISNULL([Image_Link]) then
    <myimagecontrol>.visible=false
    <myimagecontrol>.height=0
    <myreportdetail>.height= (say) 15 ' note this will vary
    else
    <myimagecontrol>.visible=true
    <myimagecontrol>.height= 'whatever the image size should be
    <myreportdetail>.height= <myimagecontrol>.height+<myimagecontrol>.top
    endif
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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