Solved

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

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

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 3

Author Comment

by:bfuchs
ID: 41722075
Hi,

That worked, however got attached error in following line

Thanks,
Ben
untitled.png
0
 
LVL 119

Assisted Solution

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

with
set cNtrl=screen.activecontrol
0
 
LVL 49

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 3

Author Closing Comment

by:bfuchs
ID: 41722135
Thank you experts!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now