Question:

Display animated gif in Microsoft Access's Forms

by  |  earlier

0 LIKES UnLike

I would like to display an animated gif in MS Access's form. I been searching the web but all of them needs to install a program but i want to know how to code access to make it.

 Tags:

   Report

1 ANSWERS


  1. There is no "clean" way to get this to work as you might like ... here's a method that has some drawbacks, but does display the animated GIF on your form (without 3rd-party add-ins).

    1. Open the form in design mode

    2. From the Insert menu ... select ActiveX Control ... choose Microsoft Web Browser

    3. In the properties for the new web browser control ... set the name  to WebBrowser1 ... size the web browser control to fit your needs

    4. In the visual basic code module for the form ... from the Tools menu ... select References ... make sure that Microsoft Internet Controls is checked ... if not ... scroll down the list and select (check) it

    5. Copy and paste this code to the code module of the form (change the location and name of the GIF file to suit your needs):

    Private Sub Form_Current()

        Dim oWebBrowser As SHDocVw.InternetExplorer

        Dim sURL As String

        sURL = "file:///C:/temp/animated.gif"

        

        Set oWebBrowser = Me.WebBrowser1.Object

        oWebBrowser.Navigate sURL

    End Sub

    6. Save and then open the form ... that should do it.  Customize as you need.

    Good luck!

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.