Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Compile Error in Visual Basic

    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.

    Code:
    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?

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Well, where do you Dimension (aka Dim) OptionsNewTop?

    The error means you have dimensioned/defined the variable.
    OracleGuy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •