Forcing Intellisense to work in VBA

Status
Not open for further replies.

PaulV

New member
Local time
Tomorrow, 00:53
Joined
Jun 5, 2004
Messages
1
Hi all

It seems that some have trouble getting Intellisense to work when writing code for common controls.

The trick is to declare the objects at the beginning. For example working with a treeview control declare the treeview and nodes first eg

Dim objTVW As TreeView, objNode As Node

Declare and set your query strings and database objects next.

Then set the treeview object
Set objTVW = Me!YourTreeviewName.Object

Clear all treeview nodes
objTVW.Nodes.Clear

Set the node object and add the properties
Set objNode = objTVW.Nodes.Add([Relative], [Relationship], [Key], Text, [Image], [Selectedimage])

The Node syntax [bracketed] properties are optional, the Text is required for the node text.

Don't forget to destroy all objects at the end to free memory.
Set objNode = Nothing
Set objTVW = Nothing

Close and destroy database and recordsets
db.Close
Set db = Nothing
rst.Close
Set rst = Nothing


Paul
 
Status
Not open for further replies.

Users who are viewing this thread

Back
Top Bottom