Results 1 to 13 of 13
  1. #1
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117

    Hide an attachment in a report

    I have a form which collects data and then sends the records to a report.


    One of the controls on the form is a YES/NO button which asks the user whether an attachment is available for the particular record.
    If the answer is YES I want the attachment to appear on the report
    If the answer is NO then I don't want the attachment to appear on the report.
    Is this possible and if so any pointers as to how ?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    How are you sending the email...
    if docmd.output method

    'scroll thru your users list
    if tUsers.Send then
    docmd.output report...
    end if

    'if email.send method then dont use the email.attach option

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is this to send email with attachment?

    Do you want to dynamically display images on Access report? For Access 2003 review http://support.microsoft.com/kb/285820
    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.

  4. #4
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    I think I may have not explained what I need properly.
    I have a data entry form which is used to collect data about a part number.
    The user fills in the data on the form and then once complete, this data is stored within the database and is used to produce an inspection report for the part number.
    The user can choose to view the report by choosing a part number from a combo box.
    On the data entry form I have put a check box to indicate whether an attachment is available for the part number (this attachment gives additional details) and where applicable have attached the details within the forms table.
    What I now need to happen is that when the user goes to the combo box and chooses a part number, the inspection report will come into view and if the check box is ticked then the attachment appears. If the check box is unticked then I do not want the attachment to appear.
    It has nothing to do with e-mails.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What is 'attachment' - just another Access report or an external file?
    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.

  6. #6
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    The attachment is a JPEG image which is one of the fields in the Table which is the source which runs the query which runs the report

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You are using Access 2003?
    What kind of field - OLEObject?
    Did you review the link I posted?
    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
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    I am using Access 2007
    The field is an attachment field as selected when the Table was designed
    I did not see a link in your post - did I miss it ?

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    In post 3 but since you have Access 2007, just disregard. (Might change your profile.)

    Use an Image control to dynamically display jpeg images from the attachment field.

    Set ControlSource property.
    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
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    How does this link to the Yes/No button which the user changes to suit the individual part

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Maybe don't need button.

    If there is nothing in the attachment field then nothing will show in the Image control.

    Why should user have to know if there is an attachment?
    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.

  12. #12
    FJM is offline Competent Performer
    Windows 98/ME Access 2003
    Join Date
    Jun 2010
    Posts
    117
    I want the image control to not show on the report if the user has not checked the YES/NO button.
    Some parts will have an image and some parts will not

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Programmatically removing control from report is a design modification and requires opening report in Design view. I don't think removing control is practical if report shows multiple records.

    Suggest you have a 'placeholder' image - a jpeg that just says 'no image available'.
    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: 6
    Last Post: 12-12-2011, 09:57 PM
  2. Display pdf attachment in report
    By BrianPeerless in forum Reports
    Replies: 5
    Last Post: 05-05-2011, 12:18 PM
  3. Table with attachment field and report
    By Yaan in forum Access
    Replies: 0
    Last Post: 02-18-2011, 02:12 AM
  4. Save Report in Attachment
    By A S MANN in forum Queries
    Replies: 1
    Last Post: 10-08-2010, 08:33 PM
  5. Replies: 0
    Last Post: 07-06-2010, 08:12 AM

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