Solved

Change Label color in module without passing any arguments

Posted on 2013-10-27
2
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

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

Author Closing Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

688 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