Solved

How do I check if a control variable has something assigned?

Posted on 2016-07-20
5
49 Views
Last Modified: 2016-07-20
Hi Experts,

I have a sub that expects two optional variables, a control and a label.
How do I check if they contain something?

See attached.
untitled.png
0
Comment
Question by:bfuchs
  • 2
  • 2
5 Comments
 
LVL 50

Accepted Solution

by:
Ryan Chong earned 350 total points
ID: 41722064
try check
If cNtrl Is Nothing Then

Open in new window

and
If lBl Is Nothing Then

Open in new window

0
 
LVL 4

Author Comment

by:bfuchs
ID: 41722075
Hi,

That worked, however got attached error in following line

Thanks,
Ben
untitled.png
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 150 total points
ID: 41722080
change
cNtrl=screen.activecontrol

with
set cNtrl=screen.activecontrol
0
 
LVL 50

Assisted Solution

by:Ryan Chong
Ryan Chong earned 350 total points
ID: 41722083
try add Set in front of that statement?

Set object = Someotherobject
0
 
LVL 4

Author Closing Comment

by:bfuchs
ID: 41722135
Thank you experts!
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
type of query 11 41
What's wrong with CopyFromRecordset 6 33
Normalization of a table 19 70
Attachment field in SQL 3 26
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

785 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