Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Change Label color in module without passing any arguments

Posted on 2013-10-27
2
Medium Priority
?
386 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 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

618 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