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
Solved

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

Posted on 2016-07-20
5
50 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
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…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

792 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