Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 7 64bit Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Image

    I have posted this thread many months ago, but still would like a solution. The "Image" option is better for us for multiple reasons. When we set up our forms, images display distorted as on the attached example, even though it prints perfect. We want to store images outside access, therefore not going for OLE choice or attachment


    Click image for larger version. 

Name:	THBUS.png 
Views:	124 
Size:	80.6 KB 
ID:	35545

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Store the path to the image as text in your table. set the image controls .picture property to the photos path.

    Code:
    me.YourImageControl.picture = "C:\MyPics\Staff\Jim.jpg"

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    don't think access image control has a .picture property, it's .controlsource

    as moke says, create a text field in your table and store the full path and file name/extension

    then bind your image control to this field

    if all the pictures are all stored in the same directory, just store the file name/extension and add the path in the controlsource

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    No, there is a picture property.
    the code to use it is
    Code:
    Me.Image1.Picture = "the path to the photo"
    Click image for larger version. 

Name:	picprop.JPG 
Views:	121 
Size:	29.3 KB 
ID:	35547

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I stand corrected - but still say use the controlsource

  6. #6
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Quote Originally Posted by Ajax View Post
    I stand corrected - but still say use the controlsource
    Doesn't exist.

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    it does -

    Click image for larger version. 

Name:	Capture.JPG 
Views:	122 
Size:	15.9 KB 
ID:	35551

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    VBA setting Picture property to dynamically display images with Image control was required back with A2003 before ControlSource property added.

    What image type are you using - jpg? png or bmp or wmp might display better in PrintPreview. Is it really an issue that PrintPreview doesn't display nice?
    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.

  9. #9
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    not sure if that is directed at me or the OP. Image types I've used - jpeg, bmp, gif, ico, png

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    If you add an image control and select an image it is added to the Picture property leaving the ControlSource blank
    I normally use the control source property for a textbox showing the image path next to the image

    Over the years, I've often found issues with using lossy formats such as jpg with access especially in print preview.
    However bmp, png, gif all normally work fine for me

    For the benefit of new Access users, here is a useful article from MS which applies to all versions from A2003 onwards: https://support.microsoft.com/en-gb/...r-a-data-acces
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  11. #11
    Perfac's Avatar
    Perfac is offline Expert
    Windows 7 64bit Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    One of you guys advised me many months ago. I tried everything not coming right. I watched many tutorials and our setup of many images is done like Moke suggest. The one of you suggested (my guess its Ridders) to save in format png, which is the only way I have done it since.

  12. #12
    Perfac's Avatar
    Perfac is offline Expert
    Windows 7 64bit Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    June7. I dont see myself as a true perfectionist, even though our business name is Perfac Consulting. Yes, it is an issue for us that these images display correct.

  13. #13
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Quote Originally Posted by Perfac View Post
    One of you guys advised me many months ago. I tried everything not coming right. I watched many tutorials and our setup of many images is done like Moke suggest. The one of you suggested (my guess its Ridders) to save in format png, which is the only way I have done it since.
    Not sure whether I suggested png but its a good choice.
    I do remember advising you about several things some months ago but I'm also aware that you didn't always follow my advice...

    Here's another piece of advice about the screenshot in post 1
    If that is real data, you really should redact it before uploading.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Again, is it really an issue that PrintPreview does not render image nicely? ReportView does, form does, printer does.
    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.

  15. #15
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Quote Originally Posted by Ajax View Post
    it does -

    Click image for larger version. 

Name:	Capture.JPG 
Views:	122 
Size:	15.9 KB 
ID:	35551
    we're talking 2 different methods.
    you can set the picture property in vba but cant set the controlsource. I think you can only bind controlsource to textbox on form using wizard or typing it in.

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

Similar Threads

  1. Replies: 6
    Last Post: 03-22-2018, 12:02 PM
  2. Replies: 2
    Last Post: 03-14-2018, 11:10 AM
  3. Replies: 1
    Last Post: 12-26-2016, 08:57 AM
  4. Replies: 3
    Last Post: 07-13-2015, 12:07 PM
  5. Replies: 2
    Last Post: 10-10-2011, 10:58 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