Results 1 to 4 of 4
  1. #1
    Nip351 is offline Novice
    Windows 10 Access 2003
    Join Date
    Feb 2017
    Posts
    6

    Question Prevent Warning of Absent Images

    I have a really simply code to show an image on a report, which works great. But some occasions the image may not be available and I want the report to simply ignore the absence of the picture and just continue to display without warning. Can someone point me in the right direction?



    Just a few notes:
    The path is static
    Images will never exist until a CNumber is generated
    They are always JPGs

    This is what I have:

    Code:
        
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
        Image163.Picture = "C:\BitBeater\license\" & [cnumber] & "a.jpg"
        Image164.Picture = "C:\BitBeater\license\" & [cnumber] & "b.jpg"
        End Sub
    If possible, I'd like to just display "Image not present." when the image is not found.

    Thank you.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    What happens if there is no picture available.
    Perhaps:
    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) 
    If Not Nz(CNumber,0) =0 Then
        Image163.Picture = "C:\BitBeater\license\" & [cnumber] & "a.jpg"
        Image164.Picture = "C:\BitBeater\license\" & [cnumber] & "b.jpg"   
    End If 
    End Sub
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Nip351 is offline Novice
    Windows 10 Access 2003
    Join Date
    Feb 2017
    Posts
    6
    I thought of similar, but it is possible that there can be a record but we don't yet have an ID to scan for a file. Therefore there would be a CNumber, but no picture. Especially since this is being created after the fact, we have 100's of records without the images, unless the customer returns.

    Would I be able to check to see if the file is present instead of the record? Then I can just say if no image, then use THIS image "..\NoImage.jpg"

    I neglected to mention this is in Access 2002, if it matters.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    If Dir("C:\BitBeater\license" & [cnumber] & "a.jpg") = "" Then
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-09-2015, 12:07 PM
  2. Pop Message Box Warning
    By data808 in forum Programming
    Replies: 4
    Last Post: 01-11-2014, 04:43 PM
  3. set warning off
    By bet in forum Programming
    Replies: 2
    Last Post: 03-27-2011, 04:21 PM
  4. Warning messages
    By Bobcoop103 in forum Access
    Replies: 3
    Last Post: 08-12-2010, 11:45 PM
  5. Replies: 17
    Last Post: 08-26-2009, 11:27 AM

Tags for this Thread

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