• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 60
  • Last Modified:

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

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
bfuchs
Asked:
bfuchs
  • 2
  • 2
3 Solutions
 
Ryan ChongCommented:
try check
If cNtrl Is Nothing Then

Open in new window

and
If lBl Is Nothing Then

Open in new window

0
 
bfuchsAuthor Commented:
Hi,

That worked, however got attached error in following line

Thanks,
Ben
untitled.png
0
 
Rey Obrero (Capricorn1)Commented:
change
cNtrl=screen.activecontrol

with
set cNtrl=screen.activecontrol
0
 
Ryan ChongCommented:
try add Set in front of that statement?

Set object = Someotherobject
0
 
bfuchsAuthor Commented:
Thank you experts!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now