Software

Bring Access forms to life with animation

Publishing your Access forms on the Web? Add some fun with animated images! Here's how to create a form that will appear to come to life when you run it.

Publishing your Access forms on the Web? Add some fun with animated images! For example, say you want to publish a form that allows your users to enter a keyword that will search your software catalog for winter specials; to illustrate this, you've embedded an image of two boys hitting the a puck with their hockey sticks. To animate the image, follow these steps:

  1. Open your form in Design view.
  2. Right-click the embedded image of the hockey players.
  3. Click Properties.
  4. Click the All tab.
  5. Click in the Name Property box and enter ctlImage.
  6. Double-click the Form Properties button in the top left-hand corner of the form window.
  7. Click the Timer Interval property box and enter 200.
  8. Click in the On Timer property box and click the Build button.
  9. Select Event Procedure and click OK.
  10. Enter the following code at the prompt:

On Error GoTo HandleError

ctlImage.Left = ctlImage.Left + 200

ctlImage.Top = ctlImage.Top + 100

ExitHere:

Exit Sub

HandleError:

ctlImage.Left = 0

ctlImage.Top = 800

Resume ExitHere

  1. Click [Alt]Q.

When you subsequently run the form, the boys will appear to skate across the form.

Miss an Access tip?

Check out the Microsoft Access archive, and catch up on other Access tips.

Help users increase productivity by automatically signing up for TechRepublic's free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.

Editor's Picks