Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    stingray is offline Novice
    Windows 11 Office 365
    Join Date
    Jan 2025
    Posts
    22

    Image only shows on the report under certain condition

    Since I could not generate UPC-A with a free font (If someone can help me with this, then I don't need to go through this image problem...), I decided to upload a barcode image (5KB) and have it in the accdb as attachment type.

    The problem is that the image does not show in Report. The ONLY time it appears is when I register a new product (with a new barcode image) from a Form. Then barcodes appear in Report, regardless of the product (old and new) as long as I don't close the file. Once I restart the file, it does not show on the Report. It always shows in the Form. It would be great to upload an image (jpeg, png, gif) via drag & drop in a Form.
    It is in an Image Control container in Report. Access 365. DB is about 3MB now. Please help.


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Suggest you provide files for analysis. Follow instructions at bottom of my post.
    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.

  3. #3
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    433
    i think you need to Re-Open the report (Print Preview) when you want to reflect new changes to the report.
    on Report View, you can try to Refresh the Report (on the Ribbon).

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    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.

  5. #5
    stingray is offline Novice
    Windows 11 Office 365
    Join Date
    Jan 2025
    Posts
    22

    Sample database uploaded

    Hello, OP here.
    Attached is the file that I have been struggling with. I will be most glad and grateful if you solve the mystery.

    I not sure how I can "refresh" the print preview page. I did not see that option. Probably that is not it, because I close and reopen the database, and everything else except for the barcode image shows.

    Thank you!
    Attached Files Attached Files

  6. #6
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    to start, I think you need to add option explicit to your modules and correct the errors.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    It's annoying that Option Explicit is not included by default in every module for Access (it is in Excel).

    In the VBA editor > Tools > Options > Editor > check "Require Variable Declaration"

    Will have to manually add to existing modules.

    I've never seen a db where tables have no relationships at all and query for report relies on Cartesian association of records. However, query works so report should as well. Consider that with a large dataset this can significantly slow performance.

    I deleted the Image control then dragged attachment field from Field List to report. Image works.
    Note difference in appearance and properties for these two controls.

    Also, should be aware that attachment type field is a type of multi-value field. I avoid MVFs whenever possible.
    Last edited by June7; 02-03-2025 at 03:38 PM.
    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.

  8. #8
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    It's annoying that Option Explicit is not included by default in every module for Access (it is in Excel).
    No - its the same across all Office apps.
    Ticking Require Variable Declaration in e.g. Access then applies not only to all other Access apps in future but also to all Excel / Word documents as well.
    Similarly, unticking in e.g. Excel will have the same effect in Access
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Oops, stand corrected. Yep, verified that behavior.
    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.

  10. #10
    stingray is offline Novice
    Windows 11 Office 365
    Join Date
    Jan 2025
    Posts
    22
    Quote Originally Posted by June7 View Post
    It's annoying that Option Explicit is not included by default in every module for Access (it is in Excel).

    In the VBA editor > Tools > Options > Editor > check "Require Variable Declaration"

    Will have to manually add to existing modules.

    I've never seen a db where tables have no relationships at all and query for report relies on Cartesian association of records. However, query works so report should as well. Consider that with a large dataset this can significantly slow performance.

    I deleted the Image control then dragged attachment field from Field List to report. Image works.
    Note difference in appearance and properties for these two controls.

    Also, should be aware that attachment type field is a type of multi-value field. I avoid MVFs whenever possible.
    How did you do this:
    > then dragged attachment field from Field List to report.

    I opened the query and dragged the attachment field to the report in design view, but that was not the correct way. Could you please explain a bit more?

    I would love to avoid multi-value field, but my poor skill forces me to keep it. It is because of the sample method that I found in Youtube for drag-and-drop upload.
    https://www.youtube.com/watch?v=wZD0rvwl6eA&t=742s

    Thank you!

  11. #11
    stingray is offline Novice
    Windows 11 Office 365
    Join Date
    Jan 2025
    Posts
    22
    OP here.
    Did this: VBA editor > Tools > Options > Editor > check "Require Variable Declaration"

    Once again, the DB is uploaded. Thank you!
    Attached Files Attached Files

  12. #12
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    433
    here test your db.
    Attached Files Attached Files

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Report in design view.
    On ribbon Report Design, click on Add Existing Fields.
    Click & Drag or double click field from Field List to report.
    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.

  14. #14
    stingray is offline Novice
    Windows 11 Office 365
    Join Date
    Jan 2025
    Posts
    22
    Quote Originally Posted by June7 View Post
    Report in design view.
    On ribbon Report Design, click on Add Existing Fields.
    Click & Drag or double click field from Field List to report.
    Thank you. I see it now.

  15. #15
    stingray is offline Novice
    Windows 11 Office 365
    Join Date
    Jan 2025
    Posts
    22
    Quote Originally Posted by jojowhite View Post
    here test your db.
    The strange thing was that when I applied this change onto the real DB, it gave me an error, saying that it is NOT going to come from "BaseQuery" any more, are you OK? It did not work. So I went back to your sample DB. I could not find anything special, so I went back and did it again. It worked. I don't know what happened, but it is working now, so I am happy! Thank you so much. Now I have to deal with the code part to upload the image.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 12-08-2020, 12:23 AM
  2. Replies: 6
    Last Post: 09-18-2020, 09:06 PM
  3. Replies: 5
    Last Post: 07-10-2020, 12:41 PM
  4. Replies: 2
    Last Post: 04-13-2020, 02:45 AM
  5. Replies: 3
    Last Post: 05-29-2013, 05:38 PM

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