Declaration expected

Malcolm Fellmann 5 Reputation points

Public Module GlobalVariables

Public gDataGridShowing

Public gDatabase As String
```End Module

Public Class Form1

   gDatabase = "ganswind"   **<<< error "Declaration expected"**

   Function HideMenuPoints(ByVal MenuNumber)




I guess I am placing things in the wrong place?

( There is no such things as a stupid question, .... )

An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,606 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 113K Reputation points

    Try this:

    Module GlobalVariables
        Public gDatabase As String = "ganswind"
    End Module

    Or this:

    Public Class Form1
        Sub New()
            GlobalVariables.gDatabase = "ganswind"
        End Sub

    (Depending on necessities).