Is there a way to get ms-access to display images from external files

前端 未结 6 1321
予麋鹿
予麋鹿 2020-12-06 19:09

I\'ve got an MS-Access app (1/10th MS-Acccess, 9/10ths MS-SQL) that needs to display photographs of some assets along with their specifications. Currently the images are sto

相关标签:
6条回答
  • 2020-12-06 19:32

    Another option is to put an image control on your form. There is a property of that control (Picture) that is simply the path to the image. Here is a short example in VBA of how you might use it.

    txtPhoto would be a text box bound to the database field with the path to the image imgPicture is the image control The example is a click event for a button that would advance to the next record.

    Private Sub cmdNextClick()
        DoCmd.GoToRecord , , acNext
        txtPhoto.SetFocus
        imgPicture.Picture = txtPhoto.Text
        Exit Sub
    End Sub
    
    0 讨论(0)
  • 2020-12-06 19:32

    I found that this article by Microsoft with full VBA worked very well for me.

    How to display images from a folder in a form, a report, or a data access page

    0 讨论(0)
  • 2020-12-06 19:35

    Note that in Access 2010 (and later) this is dead simple to do because the Image control can be bound to a field in the table that contains the path to the image file (.jpg, .png, ...). No VBA required.

    For more details see my other answer here.

    0 讨论(0)
  • 2020-12-06 19:50

    You can try an ActiveX control called AccessImagine, makes adding images to database more convenient - you can load from file, scan, paste from buffer or drag-n-drop. You can crop image right inside the database and resample it automatically. It handles external image storage automatically if you need it.

    0 讨论(0)
  • 2020-12-06 19:51

    The easiest way is probably to plop an Internet Explorer onto one of your forms. Check out this site: http://www.acky.net/tutorials/vb/wbrowser/

    Since you can reference that object in Access, you will only need to point the webbrowser control to the path of the .jpg (NavigateTo() if I remember correctly).

    EDIT: The above link was just googled and picked from the results (first one that opened quickly). I do not think it is a very good tutorial, it just has all the pointers you need... Check out msdn etc. if you need more information!

    0 讨论(0)
  • 2020-12-06 19:55

    Have you looked at Stephen Lebans' solutions? Here's one:

    Image Class Module for Access

    Check out the list of other great code along the left-hand side of that web page. You may find something that fully matches what you need.

    0 讨论(0)
提交回复
热议问题