<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=34083602&amp;blogName=LEARN+MS-ACCESS+TIPS+AND+TRICKS&amp;publishMode=PUBLISH_MODE_FTP&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http%3A%2F%2Fblogsearch.google.com%2F&amp;blogLocale=en_US&amp;homepageUrl=http%3A%2F%2Fwww.msaccesstips.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>
www.msaccesstips.com

LEARN MS-ACCESS TIPS AND TRICKS


International Response Fund

LEARN MS-ACCESS TIPS AND TRICKS

↑ Grab this Headline Animator

Your Ad Here
Tuesday, October 07, 2008

Wave Shaped Reminder Ticker

We have already seen how to create and install a Reminder Ticker that runs on a straight line on the Main Screen. We could do this with few lines of VBA Code and a Label on the Main Screen. We will try something different this time. This one not runs on a straight line but runs in a Zigzag form. An image of a sample run of this method is given below:


Zigzag sample Run

To create this Ticker we need a series of labels arranged in a wave like form and each one of them must be named in such a way that we could address them easily in code. A sample design is given below:


Zigzag sample Design

There are about 42 identical Labels to create. Even if we create them once manually, arranging them in this fashion is not an easy task. But we can do it with a small Program. The Program creates a new Form and creates all 42 Labels, name them as lbll to lbl42, changes other Properties as shown above.


  1. Copy the following Code into a Global Module of your Database and save it.


  2. Public Function ZIGZAG()
    '-----------------------------------------------------------
    'Author : a.p.r. pillai
    'Date : 01/10/2008
    'URL : www.msaccesstips.com
    'All Rights Reserved by www.msaccesstips.com
    '-----------------------------------------------------------
    Dim frm As Form, ctrl As Label, t As Long, lngleft As Long
    Dim lngwidth As Long, lngheight As Long, lngtop As Long
    Dim j As Integer, k As Integer, h As Long, G As Long

    h = 30: G = 0: t = 0
    lngwidth = 0.1146 * 1440
    lngheight = 0.2083 * 1440
    lngtop = 1 * 1440
    lngleft = 0.16667 * 1440
    Set frm = CreateForm
    For j = 1 To 42
    Set ctrl = CreateControl(frm.Name, acLabel, acDetail, , , lngleft, lngtop, lngwidth, lngheight)
    lngleft = lngleft + lngwidth
    With ctrl
    .Name = "lbl" & j
    .FontName = "Tahoma"
    .FontSize = 8
    .Caption = ""
    .BackStyle = 0
    .ForeColor = 255
    End With
    Next
    G = 0
    For j = 1 To 3
    For k = 1 To 7
    G = G + 1
    Set ctrl = frm.Controls("lbl" & G)
    With ctrl
    .Top = .Top - (h * k)
    End With
    DoEvents
    Next
    t = frm.Controls("lbl" & G).Top
    For k = 1 To 7
    G = G + 1
    Set ctrl = frm.Controls("lbl" & G)
    With ctrl
    .Top = t + (h * 1)
    End With
    t = frm.Controls("lbl" & G).Top
    DoEvents
    Next
    Next
    End Function

  3. You can run the above Code directly by placing the cursor in the middle of the Code and pressing F5 Key, or running from a Command Button's On Click Event Procedure or from a Macro.


  4. Every time when the code is run it will create a new Form with the Labels arranged in a zigzag form. After you create it once, export that Form into your other Projects where you want to install the ZigZag Ticker. Or you may install the code in a Common Library Database and run it after attaching the Library File to your Project.

  5. After creating the Labels, click somewhere outside the Labels and drag over them so that all the Labels are selected without disturbing the arrangement of the labels.

  6. Select Copy from Edit Menu.

  7. Open the Main Switch Board (Control Form) in Design View and Paste them.

  8. When all the labels are still in selected state drag and place the Labels into position where you want the Ticker to appear on the Form.


  9. We have two more Sub-Routines which are run from the Form_Load() and Form_Timer() Event Procedures. On the Form_Load() Event Procedure we can create a Text Message in a String either with a constant value or with Field Values from a Table/Query that provide useful information to display to the User as a reminder. Refer the earlier example Reminder Ticker Form which uses information from within the Application for Reminder.


    The Form_Timer() Event Procedure will control the Display of Label values shifting one character at a time in succeeding labels giving it a sense of motion.


  10. Copy and the Paste the following Sub-Routines into the Form Module where you have pasted the above labels.


  11. Option Compare Database
    Option Explicit
    Dim txt As Variant

    Private Sub Form_Load()
    txt = Space(42) & UCase("Excellence is not a matter of chance. It is a matter of Change. It is not a thing to be waited for. It is a thing to be achieved.")
    Me.Timerinterval=250
    End Sub

  12. See that the Dim txt As Variant is placed in the Global Area of the Module, which is referenced from the Form_Load() and Form_Timer() Event Procedures.


  13. Private Sub Form_Timer()
    Dim x As String, k As String, j As Integer, ctrl As Control

    x = Left(txt, 1)
    txt = Right(txt, Len(txt) - 1)
    txt = txt & x
    k = Left(txt, 42)
    For j = 1 To Len(k)
    Set ctrl = Me.Controls("lbl" & J)
    Ctrl.Caption = Mid(k, j, 1)
    Next
    End Sub


  14. The following lines of code are useful if you plan to disable the ticker when the Main Form is inactive and run it again when the Main Form is active again, so that other processes not interrupted by the Ticker.



Private Sub Form_Deactivate()
Me.TimerInterval = 0
End Sub


Private Sub Form_Activate()
Me.TimerInterval = 250
End Sub



StumbleUpon Toolbar



Opening dBase Files Directly
Opening External Data Sources
PIE Chart Object and VBA
Column Chart and VBA
Working with Chart Object in VBA

Labels:

0 Comments:

Post a Comment

Note:Comments subject to Review by Blog Author before displaying.

Links to this post:

Create a Link

<< Home


Creative Commons License
Learn MS-Access Tips and Tricks by msaccesstips.com is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 India License.



This Page is best viewed with 1280 x 1024 Resolution

   FEATURED LINKS
SITEMAP
Command Button Animation
3D Headings on Forms
MsgBox & Office Assistant
Reminder Ticker
MS-Access & E-Mails
Automated E-Mail Alerts
MsgBox with Options Menu
Colorful Command Buttons
Configure Lotus Notes
Alerts through Network
Running this site has become a costly affair as the revenue from Ads is not sufficient to support it. If you find these pages informative & useful and would like to extend a helping hand, then please do it here.





Link Back to us with this Button

Learn MS-Access

Copy and Paste this HTML Code in your Webpage


Add to Technorati Favorites

Programming Blogs - Blog Catalog Blog Directory
Powered by FeedBurner
Add to Google

Software
Computers blogs
TopOfBlogs




AddMe - Search Engine Optimization Submit Your Site Free!
Go BlogZ Ave Blogs
eBlogzilla Changing LINKS
LS Blogs Blogarama
blog search directory BlogUniverse
Find Blogs in Directory RSS Directory
blogskinny.com ShowcaseBlogs.com
Amfibi

Search Engine Optimization and SEO Tools
Dmegs Web Directory Takeaway for Sale Businesses For Sale
Free Submission Directory Free site submission

Free Listing
 





Free Page Rank Checker

AddThis Social Bookmark Button

Enter your email address:

Delivered by FeedBurner



Top Blogs


Microsoft Access is the Jewell among MS-Office suite of Applications. Its Security features are excellent and works fine in Network environment. MS-Access can link/upload data from any Data Source. Applications that you design should be user-friendly and visually pleasing too. Here I would like to share my experience in Microsoft Access Programming with you and I am sure that you will find them interesting too.

My Photo
Name: Ramachandran Pillai
Location: Cochin, India

I am not an Access Guru and not through MS-Access yet. More to learn and I don’t think that aspect has any end because others have their own style of using this tool. We can learn lot more tricks, other than what we already know, from others too. My programming skills in COBOL, BASIC, Turbo-C, dBase, FoxPro, Visual Basic & Basic HTML attained through self-learning. I wrote my first COBOL Program in 1975 for ICL1901, 3rd Generation Main Frame Computer. Worked as a Computer Operator (NCR VRX8555 Mainframe Machine upto 1990) with M/s. Y.B.A. Kanoo, Saudi Arabia. Started using MS-Access Ver.2 in 1996, when dBase III+ and Foxbase (later version Foxpro) were my favorite DBMS. During Last 13 Year period I have developed more than 45 In-House Applications (medium & small) under MS-Access for our Organization, a leading Automotive Company in Oman. All the Applications are fully Secured and runs under Windows Network. It is my pleasure to share my experience with others. Anything interesting that you would like to share with me, please do. My E-mail Address: aprpillai@msaccesstips.com


If you need a Demo of any of the Topic explained here, send me an E-mail to: aprpillai@msaccesstips.com
with the Topic Description, I shall try to send a sample database to you.


Access Tips | Email | Reports | Report Tricks | Graphs | Forms | Menus | Animation | Security | Internet | How TOs | Linking | Query | Progress Meter | Alerts | Process Tips | Access Functions |




Site Designed by:www.msaccesstips.com