Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi everyone, I can create some o

Status
Not open for further replies.

yippiekyyay

Programmer
Oct 26, 2002
186
CA
Hi everyone,

I can create some objects such as textboxes at runtime thanks to this thread - thread222-687700

But I was wondering if the same could be done for an adodc control? Why is it that the following will not work?
Dim Adodc1 As Adodc
Set Adodc1 = Form1.Controls.Add("Adodc", "Adodc1")
Adodc1.Visible = True
Adodc1.Left = 50
Adodc1.Top = 50

I appreciate any advice (related to this question)!

-Sean
 
The type has to be either defined by you, or referenced to the correct library using references.
 
Thanks everyone - adding MSAdodcLib as a prefix worked perfectly! I don't know how you guys know this though!?! The intellisense (sp?) kicks in after you type in your first dot operator - but it's the starting point that I still seem to struggle with.

Thanks again!

-Sean
 
The intellsense also shows the parent library.

Get in the habit of always using full identifiers.
This way you avoid problems later when another object uses the same name at the same level.

The best way to identify the parent component is to use the Object browser. When you select an item, at the bottom of the window you will see the parent library/object the selected item belongs to. Click on this to see if it also has a parent.
 
Thanks CCLINT - I can tell that this will help alot!

Cheers!
-Sean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top