Animated GIF on a Form (1 Viewer)

PaddyIrishMan

Registered User.
Local time
Today, 01:24
Joined
Jun 5, 2002
Messages
166
Hi all,
Anybody got any ideas on how to display an animated GIF on a form?

Thanks in advance,
Patrick.
 

PaddyIrishMan

Registered User.
Local time
Today, 01:24
Joined
Jun 5, 2002
Messages
166
Thanks GHudson, I'll check this out.
A lazy search by me for 'Show Gif on Form' only returned 2 irrelevant topics - that's why I posted a new one. :rolleyes:

Regards,
Patrick
 

R. Hicks

AWF VIP
Local time
Yesterday, 19:24
Joined
Dec 23, 1999
Messages
619
If you want to use a "true" animated GIF file in Access .... go to the link below.
There are other ways to emulate the GIF animation by capturing the images and using a timer to animate them.
There are examples of this method in the same code archive forum also.

Animation with Animated GIF's in Access

RDH
 

Elana

Registered User.
Local time
Yesterday, 17:24
Joined
Apr 19, 2000
Messages
232
Hi-

I tried Ghudson's example for using an "animated" gif and it works great - only I have one problem, which I described in a post 10 days ago that no one has responded to.

Thought I'd post on this thread with the hope that you can help me.

I've created a Please Wait form to display while a semi-lengthy process runs. I used the example from the MS Knowledge Base to get it to display properly:

DoCmd.OpenForm "frmpleasewait", , , , acFormReadOnly, acWindowNormal
DoCmd.Hourglass True
DoCmd.RepaintObject acForm, "frmpleasewait"
DoCmd.RunMacro "macrunskiappqueries"
DoCmd.Close acForm, "frmpleasewait", acSaveNo


When I open the form using the above code, the animation doesn't work, but when I just open the form manually, it works fine. Is there something I'm missing here? Is the repaintobject causing the problem?

Any ideas as to what I can do to make this work properly?

Any push in the right direction is much appreciated.
 

ChrisO

Registered User.
Local time
Today, 10:24
Joined
Apr 30, 2003
Messages
3,202
Hi Elana

Anything that relies on the timer event to be called will fail while Access is processing any procedure.

The timer event only gets called when Access is idle. If you need to update animation during processing you will have to check the update time and call the animation procedure in code.

I think that might be difficult in a Macro but if you can convert it to VBA you should be OK.

Regards
Chris
 

Elana

Registered User.
Local time
Yesterday, 17:24
Joined
Apr 19, 2000
Messages
232
Thanks - I didn't realize that about the Timer. I now know what to do to fix things.

E
 

Elana

Registered User.
Local time
Yesterday, 17:24
Joined
Apr 19, 2000
Messages
232
Hi Again,

I feel like such a dolt - while I have designed several applications in Access, I've never really had to work with the Timer. I'm self-taught and for some reason I can't get my brain around this particular concept.

Could you possibly give me an example of how I would check the time using code. Just a slight push in the right direction and I'm sure I can figure out the rest.

Many thanks in advance for your help.

E
 

ChrisO

Registered User.
Local time
Today, 10:24
Joined
Apr 30, 2003
Messages
3,202
Code:
Option Explicit
Option Compare Text

Public Declare Function timeGetTime Lib "Winmm.dll" () As Long


Public Sub Test()
    Dim lngI     As Long
    Dim lngStart As Long
    
    lngStart = timeGetTime()
    
    For lngI = 1 To 100000
        [color=green]'  This should call DoAnimation every 100 milliseconds.[/color]
        If timeGetTime() > lngStart + 100 Then
            DoAnimation
            lngStart = timeGetTime()
        End If
    Next lngI
    
End Sub


Public Sub DoAnimation()

    Debug.Print "x"
    
End Sub
Hope that gets you started and good luck.

Regards
Chris.
 

Users who are viewing this thread

Top Bottom