Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Join Date
    Sep 2020
    Posts
    10

    Hi Micron, Moke123, Accesstos and Ajax, I'm really sorry to have put you all to so much trouble, but feel this problem is beyond my capabilities as I'm a beginner. I barely understand the language and all the experiments take more time than I'm able to devote to them, so I am (disgracefully) giving up on this one. Thanks for all your efforts. Helen

  2. #17
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    7,501
    You didn't comment on the suggestion to post a zipped db copy along with any supporting files. Is that not an option for you?
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    "Everyone has a photographic memory; some just don't have film." Steven Wright

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,855
    This code behind report works for me. Image field is a text field with image path. I also avoid attachment type field, however, should be a way to determine if attachment field has object.
    Code:
    Option Compare Database
    Option Explicit
    Dim lngImgHt As Long
    
    
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If IsNull(Me!Image) Then
        Me.Image82.Height = 0
        Me.Detail.Height = 0
    Else
        Me.Image82.Height = lngImgHt
    End If
    End Sub
    
    
    Private Sub Report_Load()
    lngImgHt = Me.Image82.Height
    End Sub
    I found how to check if attachment field has content:
    If IsNull(DLookup("Test1.FileData", "Umpires", "ID='" & Me!ID)) Then

    Instead of DLookup, could include FileData expanded field reference in query used as report RecordSource then reference same as any other field in code.

    My code still works with Image control bound to attachment field.

    Attachment field contains only 1 object per record.

    I also tested an Attachment control (never used before because I don't use attachment fields) and code also works for that. But with Attachment control can use AttachmentCount property to check for content.
    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.

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

Similar Threads

  1. Replies: 19
    Last Post: 05-23-2020, 05:07 PM
  2. Replies: 4
    Last Post: 02-01-2019, 08:39 AM
  3. Replies: 8
    Last Post: 12-17-2017, 12:33 PM
  4. Replies: 17
    Last Post: 07-15-2014, 06:17 AM
  5. Replies: 1
    Last Post: 10-10-2012, 12:25 PM

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 - Senior Forums