473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Test for Nothing

How can I test (in VBA code) if an object is set to Nothing.
Specifically, I'm trying to check whether I've yet saved a node from a
treeview control so that I can remember where I've been in code to
change the selected node when a node is collapsed?

At present, the relevant bits of my code are:

Option Compare Database
Option Explicit

Dim nodPrevious As Node

-----------------------
Private Sub tvwWP_NodeClick(ByVal Node As Object)
Dim ...

'Save this node for collapse
Set nodPrevious = Node

'Filter Risks by the selected node on the form
....
End Sub
------------------------
Private Sub tvwWP_Collapse(ByVal Node As Object)
Dim ...

If Not nodPrevious = Nothing Then '*** THIS IS WHERE I NEED TEST
...
End If
End Sub
------------------------

My problem arises because it's possible to expand and collapse the
tree without clicking on a node (or, more specifically, using the +/-
symbols does not trigger the NodeClick event).

BTW, if anyone can recommend a good tutorial on using treeview
controls in Access, I'd really appreciate it. I've found a couple,
but they seem to focus mostly on populating the control from code;
I've found nothing really helpful about subsequent manipulation, or
useful events, or ...

TIA,

Rob
Nov 13 '05 #1
1 19361
On 24 Aug 2004 17:59:22 -0700, ro***********@dsto.defence.gov.au (Rob
Parker) wrote:

If Not nodPrevious Is Nothing Then
-Tom.

How can I test (in VBA code) if an object is set to Nothing.
Specifically, I'm trying to check whether I've yet saved a node from a
treeview control so that I can remember where I've been in code to
change the selected node when a node is collapsed?

At present, the relevant bits of my code are:

Option Compare Database
Option Explicit

Dim nodPrevious As Node

-----------------------
Private Sub tvwWP_NodeClick(ByVal Node As Object)
Dim ...

'Save this node for collapse
Set nodPrevious = Node

'Filter Risks by the selected node on the form
...
End Sub
------------------------
Private Sub tvwWP_Collapse(ByVal Node As Object)
Dim ...

If Not nodPrevious = Nothing Then '*** THIS IS WHERE I NEED TEST
...
End If
End Sub
------------------------

My problem arises because it's possible to expand and collapse the
tree without clicking on a node (or, more specifically, using the +/-
symbols does not trigger the NodeClick event).

BTW, if anyone can recommend a good tutorial on using treeview
controls in Access, I'd really appreciate it. I've found a couple,
but they seem to focus mostly on populating the control from code;
I've found nothing really helpful about subsequent manipulation, or
useful events, or ...

TIA,

Rob


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jussi Mononen | last post by:
Hi, I'm having problems to successfully execute the test scripts on a Compaq host ( OSF1 tr51bdev V5.1 2650 alpha ). Almost all tests end up with the following error message "PARI: *** ...
6
by: WindAndWaves | last post by:
Hi Folks I have inhereted a script that I understand reasonably well, I just do not understand !/^\d+$/.test(el.value) what the hell does that mean? Below is the script (there are really...
0
by: cpavon | last post by:
Hello everyone, I am fairly new to MACT, I am currently trying to parse the oResponse.Body to retrive a dynamic values...store in an array and then randomly post those values. Does anyone...
0
by: Sri. | last post by:
Hi I am trying to figure out how to test whether my browser cookies are enabled. I used the code from the following page...
4
by: BrianDH | last post by:
Hi I have an application with 3 windows forms. One of which I load at startup but hide, then show/hide based on users click. How can I test to see if the windows is hidden, or is at the moment...
3
by: Alexis | last post by:
Hello, I have developted a webservice application. The application has a few webservices each webservice with their own webmethods of course. I want to measure the performance of my site. I look...
38
by: Astra | last post by:
Hi All Could somebody please confirm that if I change my JS expression test from: if (!(/^*$/.test(document.form1.fred.value))) to if (!(/^*$/.test(document.form1.fred.value)))
176
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write...
1
by: jweiss | last post by:
I am trying to run cmd.exe so that I can ftp a file to a remote server. I've been doing this for a long time, but something broke. I did some windows updates last week?? I am getting a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.