...

View Full Version : Compile Error in Visual Basic



NickBomb
08-03-2007, 10:22 PM
Hi!

I am trying to make a program in Visual Basic, but when I compile I get this:
Compile error:
Variable not defined

I'll post my code below.



Private Sub OptionsButton_Click()
Options.Visible = True
OptionsNewTop = Start.Top + Start.Height

Do
Options.Top = Options.Top - 1
Loop Until Options.Top = OptionsNewTop
End Sub


This code is assigned to a button at form "Start".
The button shall open another form below "Start", that shall begin to slide down, to reveal itself.

I guess I will get many errors, but this first error is about the variable "OptionsNewTop" I think.

Can you please correct my code, or point out my error?

oracleguy
08-03-2007, 10:34 PM
Well, where do you Dimension (aka Dim) OptionsNewTop?

The error means you have dimensioned/defined the variable.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum