View Full Version : Compile Error in Visual Basic

08-03-2007, 11:22 PM

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

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?

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

The error means you have dimensioned/defined the variable.