
RunTime 91 - Object variable or With variable not set
I don't know if I've understtod your question correctly.
As far as I know, VB will not let you create controls at run time. You can only
create objects.
You can create controls at run time only if you have created one at design time
and made it part of a control array.
Say you need three text boxes. You have to create the first one text1(0) and give
it an index =0.
Then you can create the other two at run time
load text1(1)
text1(1).visible = true
and the same with the third member. You need to set the left, top, height and
width properties yourself in code.
For more information, search for Control arrays in Online help.
Hope this helps....
Quote:
> I get runtime 91 - object variable or with variable not set
> Dim wTextBox As RichTextBox
> 'With wTextBox
> wTextBox.Text = "Field " + wField
> wTextBox.Left = CSng(wX)
> wTextBox.Top = CSng(wY)
> wTextBox.Width = CSng(wWidth)
> wTextBox.Height = CSng(wHeight)
> when I debug, it says that wTextBox is (nothing) Am I doing something wrong?
> I want to create the wTextBox as part of TheForm (as form) at run-time.
> Can anyone give me a few tips?
> I had tried setting the parent to TheForm by wTextBox.parent = TheForm but
> that said "invalid use of property"
> If I need to post more code, I can Thanks in advance.
> **AKBishop**
> ..still resisting the Computer {*filter*}s Anonymous meetings