Solved

Change Label color in module without passing any arguments

Posted on 2013-10-27
2
369 Views
Last Modified: 2013-10-27
Hi

Office 365 /  Access question

I have a form which calls a subroutine which is found in a module.  I am trying to adapt the following code work from a module so that I can call it from several forms.

 The call to this code will only come from the active form.   The name of the label "lblTest" will always be the the same so, I would prefer to not send the label as an argument.

Call Mod_Testme

Open in new window



Public Sub mod_testme()
    Dim TheForm As Form: Set TheForm = Screen.ActiveForm
    TheForm! lblTest.ForeColor = vbRed
End Sub

Open in new window

0
Comment
Question by:peispud
2 Comments
 
LVL 26

Accepted Solution

by:
MacroShadow earned 500 total points
Comment Utility
The code you posted should work, (note: remove the extra space after "TheForm!").
0
 

Author Closing Comment

by:peispud
Comment Utility
I overlooked the obvious!    I had tried other things but not this cause it seemed to easy.  It was. Thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now