Results 1 to 11 of 11
  1. #1
    DBenz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    76

    what was the old method of making image control display a linked image ?

    Hi,


    Prior access 2007 there was a different method of feeding an image path to an image control, creating a linked image.

    what was the step by step method of doing this ?

    My old database opened into access2010 sees nothing in the data>ControlSource line where we are told we now have to enter the field that contains the image path if creating a new image control.
    yet the image controls that already existed still display images.
    How did they do manage to do that in access pre 2007 and how are they managing still ?

    I need to create new image controls and use the same OLD method, as I have found that using the new method on this form sees a horrid grid mess over my 'size mode zoom' photos.
    whilst the existing image controls on same property settings look great.

    I can but try to create new image controls still using the OLD method.

    A new dbase sees the new image control method work ok, the option to recreate from scratch the entire database is not on.
    I have more than one created in old access.

    Msoft just didnt test this did they !!

    so what was the old method ?

    if the image control has been redesigned causing this incompatability with old databse, can I somehow copy paste or whatever an existing control in design view ?


    DBenz

  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,654
    Looking back at an old post of yours you had this pic
    so I assume these are from your 2 versions.

    Click image for larger version. 

Name:	compare image frame properties v3 v6.jpg 
Views:	18 
Size:	196.1 KB 
ID:	37568

    The one on the left is using the .picture property where the one on the right is bound to a control (text box on form)

    You can set the picture property in code with
    Code:
    Me.YourImageControlName.Picture = "Path to your image"
    to use the controlsource property you would have a textbox on the form with the picture path and set that textbox as the controlsource of the image.

  3. #3
    DBenz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    76
    Hi,
    yes I see it, there in the left properties, which is for the OLD image frame, that is the path to the image I use when in design mode, the one with red size lines just about visible, that image doesnt show in normal view.
    The OLD as well as the new Image Control has a field text box above it on its form into which I type the image path (or paste !) for the image control to feed on !

    However your coding might be shedding light on this.

    Here is coding I have found having clicked on form in top left corner in design view and selected show code, I have a number of image controls all from OLD access, the IAC_FilePath is for a small control showing code number or letter on the aircraft , the main picture was fed path from Picture1_FilePath field, sat just above the image on the form as mentioned:-

    Code:
    in top windows it says
    (General)         IAC_FilePath_AfterUpdate
    Option Compare database
    Option Explicit
    
    Private Sub Form_Current()
    On Error Resume Next
    If IsNull(Me![IAC1stdigit_FilePath]) Then
         Me![IAC1stdigit_frame].Visible = False
     Else
         Me![IAC1stdigit_frame].Picture = Me![IAC1stdigit_FilePath]
         Me![IAC1stdigit_frame].Visible = True
    End If
    
    If IsNull(Me![IAC2nddigit_FilePath]) Then
         Me![IAC2nddigit_frame].Visible = False
     Else
         Me![IAC2nddigit_frame].Picture = Me![IAC2nddigit_FilePath]
         Me![IAC2nddigit_frame].Visible = True
    End If
    
    If IsNull(Me![BKZ_FilePath]) Then
         Me![BKZ_frame].Visible = False
     Else
         Me![BKZ_frame].Picture = Me![BKZ_FilePath]
         Me![BKZ_frame].Visible = True
    End If
    
    If IsNull(Me![SBAC_FilePath]) Then
         Me![SBAC_Frame].Visible = False
     Else
         Me![SBAC_Frame].Picture = Me![SBAC_FilePath]
         Me![SBAC_Frame].Visible = True
    End If
    
    If IsNull(Me![GWE_FilePath]) Then
         Me![GWE_frame].Visible = False
     Else
         Me![GWE_frame].Picture = Me![GWE_FilePath]
         Me![GWE_frame].Visible = True
    End If
    
    If IsNull(Me![GPE_FilePath]) Then
         Me![GPE_frame].Visible = False
     Else
         Me![GPE_frame].Picture = Me![GPE_FilePath]
         Me![GPE_frame].Visible = True
    End If
    
    If IsNull(Me![SE_FilePath]) Then
         Me![SE_frame].Visible = False
     Else
         Me![SE_frame].Picture = Me![SE_FilePath]
         Me![SE_frame].Visible = True
    End If
    
    If IsNull(Me![PE_FilePath]) Then
         Me![PE_frame].Visible = False
     Else
         Me![PE_frame].Picture = Me![PE_FilePath]
         Me![PE_frame].Visible = True
    End If
    
    If IsNull(Me![Picture1_FilePath]) Then
         Me![Picture1_frame].Visible = False
     Else
         Me![Picture1_frame].Picture = Me![Picture1_FilePath]
         Me![Picture1_frame].Visible = True
    End If
    
    If IsNull(Me![Picture2_FilePath]) Then
         Me![Picture2_frame].Visible = False
     Else
         Me![Picture2_frame].Picture = Me![Picture2_FilePath]
         Me![Picture2_frame].Visible = True
    End If
    
    If IsNull(Me![Picture3_FilePath]) Then
         Me![Picture3_frame].Visible = False
     Else
         Me![Picture3_frame].Picture = Me![Picture3_FilePath]
         Me![Picture3_frame].Visible = True
    End If
    
    If IsNull(Me![Picture4_FilePath]) Then
         Me![Picture4_frame].Visible = False
     Else
         Me![Picture4_frame].Picture = Me![Picture4_FilePath]
         Me![Picture4_frame].Visible = True
    End If
    End Sub
    
    here was a thin line across page
    
    Private Sub IAC_FilePath_AfterUpdate()
    On Error Resume Next
    If IsNull(Me![IAC1stdigit_FilePath]) Then
         Me![IAC1stdigit_frame].Visible = False
     Else
         Me![IAC1stdigit_frame].Picture = Me![IAC1stdigit_FilePath]
         Me![IAC1stdigit_frame].Visible = True
    End If
    
    If IsNull(Me![IAC2nddigit_FilePath]) Then
         Me![IAC2nddigit_frame].Visible = False
     Else
         Me![IAC2nddigit_frame].Picture = Me![IAC2nddigit_FilePath]
         Me![IAC2nddigit_frame].Visible = True
    End If
    
    If IsNull(Me![BKZ_FilePath]) Then
         Me![BKZ_frame].Visible = False
     Else
         Me![BKZ_frame].Picture = Me![BKZ_FilePath]
         Me![BKZ_frame].Visible = True
    End If
    
    If IsNull(Me![SBAC_FilePath]) Then
         Me![SBAC_Frame].Visible = False
     Else
         Me![SBAC_Frame].Picture = Me![SBAC_FilePath]
         Me![SBAC_Frame].Visible = True
    End If
    
    If IsNull(Me![GWE_FilePath]) Then
         Me![GWE_frame].Visible = False
     Else
         Me![GWE_frame].Picture = Me![GWE_FilePath]
         Me![GWE_frame].Visible = True
    End If
    
    If IsNull(Me![GPE_FilePath]) Then
         Me![GPE_frame].Visible = False
     Else
         Me![GPE_frame].Picture = Me![GPE_FilePath]
         Me![GPE_frame].Visible = True
    End If
    
    If IsNull(Me![SE_FilePath]) Then
         Me![SE_frame].Visible = False
     Else
         Me![SE_frame].Picture = Me![SE_FilePath]
         Me![SE_frame].Visible = True
    End If
    
    If IsNull(Me![PE_FilePath]) Then
         Me![PE_frame].Visible = False
     Else
         Me![PE_frame].Picture = Me![PE_FilePath]
         Me![PE_frame].Visible = True
    End If
    
    If IsNull(Me![Picture1_FilePath]) Then
         Me![Picture1_frame].Visible = False
     Else
         Me![Picture1_frame].Picture = Me![Picture1_FilePath]
         Me![Picture1_frame].Visible = True
    End If
    
    If IsNull(Me![Picture2_FilePath]) Then
         Me![Picture2_frame].Visible = False
     Else
         Me![Picture2_frame].Picture = Me![Picture2_FilePath]
         Me![Picture2_frame].Visible = True
    End If
    
    If IsNull(Me![Picture3_FilePath]) Then
         Me![Picture3_frame].Visible = False
     Else
         Me![Picture3_frame].Picture = Me![Picture3_FilePath]
         Me![Picture3_frame].Visible = True
    End If
    
    If IsNull(Me![Picture4_FilePath]) Then
         Me![Picture4_frame].Visible = False
     Else
         Me![Picture4_frame].Picture = Me![Picture4_FilePath]
         Me![Picture4_frame].Visible = True
    End If
    End Sub

    What can you tell me about this code and how one would use it to create a NEW image control in the sub form purely for a large picture called MainPhoto_FilePath as can be seen from the property sheet you mention my screen dump for.

    I am not sure what the Picture2 and Picture3 refers to as there was only one main photo, the smaller code frames were such as IAC1stdigit_frame fed by IAC1stdigit_FilePath and I have now selected that field for that frame in ControlSource, before discovering the problems with that new method, they feed on png images.

    This was all done by a coding genius friend of mine years ago, I felt that should I ever add image controls I would have to get him to do so !

    so in a Tbl_MainPhoto in which is a field MainPhoto_FilePath as well as ID_MainPhoto (a primary key) and ID_Aircraft which is its relationship one to many link to the main tables primary key, what coding would I need to place and where, something in that line you spotted in Picture.

    am I right in saying it would say:-
    Me.Image3.Picture = "MainPhoto_FilePath"

    I try that and Msoft bdink's up warning Microsoft Access cant open the file Me.Image3.Picture = "MainPhoto_FilePath"


    see attached image of my effort,
    DBenz
    Attached Thumbnails Attached Thumbnails MainPhotoCoding.jpg  

  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,654
    I try that and Msoft bdink's up warning Microsoft Access cant open the file Me.Image3.Picture = "MainPhoto_FilePath"
    you need to supply the file path either by reference to the field, a variable, or by referencing a textbox with the path

    Code:
    Me.Image3.Picture = Me.YourFieldWhichHasTheFullFilePath
    also your pic shows that the control is bound to a field and your also setting picture property. its one or the other not both.

  5. #5
    DBenz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    76
    Hi, is this correct ?
    removed the Control Source..as oops yes silly me.
    entered instead for Picture (none) Me.Image3.Picture = Me.MainPhoto_FilePath

    the image control is image3 according to its properties, MainPhoto_FilePath is the field within the table that the subform is created from, that field is 'YourFieldWhichhasTheFullFilePath.

    but again Microsoft warning unable to open Me.Image3.Picture = Me.MainPhoto_FilePath

    how can it say that as I havent even gone out of design view to paste a path into that field yet to give it an image, or hundred more.

    That address that you saw was feeding it an image for when I was in design view, an image that wasnt there or intended to be seen when in normal viiew. I need that image control to show hundreds of images, many per record, so should I be entering image paths when in design view ? I dont have an image for it in design view, not sure of this at all.

    DBenz

  6. #6
    DBenz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    76
    replying and updating,
    The old access image control was fed via coding accessed by clicking on form top left then go showcode using command on toolbar, see code posted in #3
    I was able to copy paste an existing image control, matchits properties, name it Picture2_frame and by creating a field for its image path, it displayed image same as Picture1_frame.
    The D:\ image in picture section of properties is simply for when its in design view, that can be deleted, it helped me see where the frame was and suss image sizes for it.
    Created a third image frame, same method, tested as working, then replaced frame with a NEW one, set it up to match deleted one, AND IT WORKED.
    SO IMAGE FRAME ITSELF might be ok.
    Picture3_frame was already in code as was Picture3_FilePath.
    Then I created code for the subform by clicking on its top left corner whilst it was in main form, copy paste code in, strip out all unwanted bits, replace Picture1 text with MainPhoto
    open into form iew and IT WORKS !!!!! pure good picture.
    resize smaller and IT STILL WORKS !!!!

    oh heavenly bliss.

    Msoft overcome at last.

    and no need to pay £10 a month to get office business 365 just to get hold of access, and their tech support said no help unless you do so, which would not have managed this, but cost me a lot of ongoing subs which as this is not a business would have caused more financial problems.

    here are the visual results. no need to remake everything from scratch.

    DBenz
    Attached Thumbnails Attached Thumbnails Success Code method fix old access into 2010 image mess.jpg  

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Duplicate post https://www.accessforums.net/showthread.php?t=75745

    Prior to Access 2007, had to use VBA code in Format event setting Image control Picture property to dynamically display external images in reports. However, this will not work with forms in Continuous view. So I am guessing did not display images on Continuous forms unless they were embedded in table.

    Might find this thread about image quality interesting https://www.accessforums.net/showthr...t=73766&page=2

    I added each of your images to Image control on form and report via ControlSource. Displays fine on form and ReportView but PrintPreview has the distortion.

    As you observe, Picture property is not showing the distortion.
    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
    DBenz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    76
    Hi,
    Access2010
    I didnt see it as a duplicate though, the other is about subforms and best practice, this is about how old access used code and coding an image control.
    However I best not now have this reason for reply here as a new code fix thread.

    Coders are not going to open a thread that doesnt mention code in the title or so I thought, and I cant see a way of editing the title as ideally it should say 'what was the old coding method...etc ... then the thread becomes talk of coding later on in its development, So my post wont get the coders attention as much as if I have a thread about coding. I also like to help others so anyone looking for something similar to their problem wouldnt spot it either.
    That was why I started a thread on how the old method might have been. Hope that explains.

    (how does one edit the title ?)

    if it is felt this coding thread should follow on from tail end of the one about best controls for images and solving the grid mess, then please copy it over, alter title to include coding, I dont know how to do that.

    Coding question, reason for reply here..
    I am getting an error message as soon as I open the Form with my photoo data and the subform that displays the main photos, with my coding method for old image control method, yet it was working fine yesterday.

    What do I need to alter in the code or whatever ?

    see screen capture.

    code is:-
    Option Compare Database
    Option Explicit


    Private Sub Form_Current()
    On Error Resume Next


    If IsNull(Me![MainPhoto_FilePath]) Then
    Me![MainPhoto_frame].Visible = False
    Else
    Me![MainPhoto_frame].Picture = Me![MainPhoto_FilePath]
    Me![MainPhoto_frame].Visible = True
    End If
    End Sub


    Private Sub IAC_FilePath_AfterUpdate()
    On Error Resume Next
    If IsNull(Me![MainPhoto_FilePath]) Then
    Me![MainPhoto_frame].Visible = False
    Else
    Me![MainPhoto_frame].Picture = Me![MainPhoto_FilePath]
    Me![MainPhoto_frame].Visible = True
    End If
    End Sub
    Cheers
    DBenz
    Attached Thumbnails Attached Thumbnails GoSub error message.jpg   subFormCodeVisual.jpg  

  9. #9
    DBenz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    76
    Hi,
    also another message then appears when I try to paste a path into the MainPhoto_FilePath

    see attached.

    DBenz
    Attached Thumbnails Attached Thumbnails second error message when enter path.jpg  

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't see anything wrong. If it was working yesterday, what has changed?
    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.

  11. #11
    DBenz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    76
    Hi, beats me !

    anyhow I did a copy paste of v6 and called it v7. shut all down opened v7 and no error message appeared, put a path for pic 2 into the sub form field and no message appeared, closed form and opened it and path still there, with nice image, unlike V6 that reverted to one image, so far its behaving itself, just crazy luck.
    Glad to see I havent boobed on the coding. but why al those craze errors, its not fair.

    however report image is a mess despite it using old method of coding image controls, and this is using v2, an early version of my dbase before I altered field names and broke some links in the reports, as happens !!! well before any fiddling. this seems to be a well known issue with Msoft not fixing it since 2003, so much for care for us, , but I feature this in the image display thread.

    DBenz

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

Similar Threads

  1. Replies: 2
    Last Post: 03-14-2018, 11:10 AM
  2. Replies: 1
    Last Post: 12-26-2016, 08:57 AM
  3. Replies: 3
    Last Post: 07-13-2015, 12:07 PM
  4. Display linked image in form view
    By brs in forum Access
    Replies: 4
    Last Post: 03-16-2014, 08:55 PM
  5. making button image animated
    By chickenguru in forum Forms
    Replies: 0
    Last Post: 05-23-2012, 10:12 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