ðH geocities.com /Heartland/Pond/4805/Form11.htm geocities.com/Heartland/Pond/4805/Form11.htm .delayed x ¾PÔJ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ Ð®ì ïh OK text/html p0i ïh ÿÿÿÿ b‰.H Sun, 20 Jan 2002 13:00:33 GMT A Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) en, * ½PÔJ ïh
ACC2000: How to Use Animation ActiveX Control in Access |
The
information in this article applies to:
Moderate: Requires basic macro, coding, and
interoperability skills.
This article applies to a Microsoft Access database (.mdb) and a Microsoft
Access project (.adp).
This article shows two examples of how to use the Animation ActiveX Control in a Microsoft Access database. The Animation ActiveX Control ships with Microsoft Office Developer Edition Tools.
With Animation ActiveX Control, you can play .avi files on
a Microsoft Access form. When you open the form in Design view, you can see the
control; however, in Form view, the control is hidden until you play the .avi
file associated with the control. One common use for the animation control is
to provide animation with command buttons. If you place the animation control
on top of a command button and use the Click event of the button to invoke the Open
and Play methods of the animation control, the button appears to be
animated.
The Animation ActiveX Control supports only two types of .avi files:
uncompressed .avi files, and .avi files that have been compressed using
Run-Length Encoding. Sound components of .avi files are not played.
If you use an unsupported file format with the animation control, you receive
the following error message:
Unable to Open AVI File
Animation control
-----------------
Name: an1
Visible: No
Left: 1"
Top: .5"
Width: 1"
Height: 1"
Command button
--------------
Name: cmd1
Caption: Play Animation
Left: 1"
Top: .5"
Width: 1"
Height: 1"
OnClick: [Event Procedure]
Private Sub cmd1_Click()
Dim AviFile As String
' Type the full path to the .avi file on the following line.
AviFile = "path and filename"
With an1
.Visible = True
.AutoPlay = True
.Open AviFile
End With
End Sub
NOTE: For the code to run properly you must insert the correct path and filename of your .avi file.
Command button
--------------
Name: cmd2
Caption: Select & Play
OnClick: [Event Procedure]
Private Sub cmd2_Click()
With Cd2
.Filter = "avi (*.avi)|*.avi"
.ShowOpen
End With
With An2
.AutoPlay = True
.Open Cd2.FileName
End With
End Sub
Note that an Open dialog box appears and lets you select an .avi file, and then the .avi file plays on the form.
For more information about ActiveX Controls, click Microsoft Access Help on the Help menu, type ActiveX in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.