Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Label Animation Style-2

Introduction

Last week we have learned a simple label animation method to display Employee Names, and made it to appear character by character from right side of the label to full view. The animated label gives the Form a lively look and makes it more interesting to the  User to work with the Screen.

This week we will learn a different label animation method with the same set of labels. In the earlier method we have used two identical labels to give the employee name a 3D effect.  We will stick with the same design but the labels will be put horizontally apart in the design as shown below:

In the Current-Event Procedure of the Form the Labels will be moved in opposite direction and finally assembled into a 3D heading style as shown below:

This happens every time an employee record become current.  The labels will restart from their original design position and slowly move in opposite direction and stay in place to form the 3D Style Employee Name.

If you have gone through the earlier label animation design task then it is easy to implement this one very easily.  All you have to do is to set the following Property Settings of lbl1 and lbl2 and copy the VBA routines into the Employee Form Module.


The Label Animation Design

  1. Open your database where you have tried the earlier example.
  2. Make a Copy of the earlier Employee Form we have tried the Label Animation and name it as Employee2.
  3. Open the Employee2 Form in Design View.
  4. Click on the top label at the header of the Form and drag and move it to the right so that we will be able to click and select the labels individually and set their properties.
  5. Select the Label with the name lbl1.
  6. Display its Property Sheet (View - -> Properties) and set the following Property Values:
    • Name = lbl1
    • Width = 2.9924"
    • Height = 0.3549"
    • Top = 0.1569"
    • Left = 2.5194"
    • Back Style = Transparent
    • Border Style = Transparent
    • Font Name = Verdana
    • Font Size = 18
    • Text Align = Centre
    • Font Weight = Bold
    • Fore Color = 0
  7. Select the Label with the name lbl2.
  8. Display the Property Sheet and change the following Property Values:
    • Name = lbl2
    • Width = 2.9924"
    • Height = 0.3549"
    • Top = 0.125"
    • Left = 5.5313"
    • Back Style = Transparent
    • Border Style = Transparent
    • Font Name = Verdana
    • Font Size = 18
    • Text Align = Centre
    • Font Weight = Bold
    • Fore Color = 16777215
  9. Display the Code Module of the Form (View- -> Code).
  10. Copy and Paste the following VBA Code overwriting the existing Code:

    The Form Module VBA Code

    Option Compare Database
    Option Explicit
    
    Private Const twips As Long = 1440
    Dim i, j
    
    Private Sub Form_Current()
    Dim txtName As String
    Me.lbl1.Left = 2.5194 * twips: Me.lbl1.Top = 0.1569 * twips: Me.lbl1.Width = 2.9924 * twips: Me.lbl1.Height = 0.3549 * twips
    Me.lbl2.Left = 5.5313 * twips: Me.lbl2.Top = 0.125 * twips: Me.lbl2.Width = 2.9924 * twips: Me.lbl2.Height = 0.3549 * twips
    txtName = Me![first name] & " " & Me![Last name]
    Me.lbl1.Caption = txtName
    Me.lbl2.Caption = txtName
    i = 0
    Me.TimerInterval = 5
    
    End Sub
    
    Private Sub Form_Timer()
    Dim m, L1, L2
    i = i + 1
    m = i Mod 2
    Select Case m
        Case 0
            L1 = Me.lbl1.Left
            L1 = L1 + (0.084 * twips)
            Me.lbl1.Left = L1
        Case 1
            L2 = Me.lbl2.Left
            L2 = L2 - (0.084 * twips)
            Me.lbl2.Left = L2
    End Select
    DoEvents
    If i > 35 Then
       Me.TimerInterval = 0
       i = 0
    End If
            
    End Sub
  11. Save the Employee2 Form
  12. Open the Employee2 Form in normal view

    Click on the Record navigation control to advance each record forward one by one.

    On each record change you will find the Employee Name Labels move towards each other and assemble into place to form as a 3D heading.

  1. Textbox and Label Inner Margins
  2. Animating Label on Search Success
  3. Label Animation Style-1
  4. Label Animation Style-2
  5. Label Animation Variant
  6. Label Animation Zoom-in Style
  7. Label Animation in Colors
  8. Label Animation Zoom-out Fade
Share:

No comments:

Post a Comment

Comments are subject to moderation before publishing.

Translate



PageRank
Subscribe in a reader
Your email address:

Delivered by FeedBurner

http://clicky.com/101199826
Blog Directory Visit blogadda.com to discover Indian blogs

Search

Popular Posts

Search This Blog

Blog Archive

Powered by Blogger.

Follow by Email

Labels

Forms How Tos Functions MS-Access Security Reports msaccess forms Animations Class Module msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Array Queries msaccess reports External Links msaccess tips Accesstips Downloads Objects Property Event Menus and Toolbars Collection Object Controls MsaccessLinks Process Controls WithEvents Art Work msaccess How Tos Combo Boxes Graph Charts List Boxes VBA msaccessQuery Command Buttons Form Command Button Data Dictionary Object Emails and Alerts Query RaiseEvent Report Calculation Custom Wizards DOS Commands Data Type ms-access functions msaccess functions msaccess graphs msaccess reporttricks Custom Functions Item Object Reference msaccessprocess security advanced Access Security Add Field Type Fields Form Instances Key Macros Menus SubForm Top Values Variables msaccess email msaccess menus progressmeter Access2007 Auto-Number Copy Excel Expression Join Methods Microsoft Numbering System Records Recordset Security Split Table Time Difference Utility Workgroup Wrapper Classes database function ms-access msaccess wizards reference text tutorial vba code Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Conditional Formatting Data Filtering Defining Pages Diagram Disk Dynamic Lookup Error Handler Export External Filter Formatting Groups Hexadecimal Numbers Import Labels List Logo Macro Mail Merge Main Form Memo Monitoring Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Tables Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif msaccess msaccess alerts pdf files restore switch toolbar updating upload

Featured Post

Call Function From MouseMove Event Property

Introduction. This is about running a User-Defined Function (say myFunction(Parameter) ) on the Mouse Move Event Property of Text Boxes.  W...

Labels

Blog Archive

Recent Posts