A global variable must be declared in an independent module, not in a class module (the module of a form is a class module). If the variable will only be used inside the form, you can declare it as Private. Otherwise you need to declare it in a new or existing standard module (i.e. a module you can see in the database window of your application). In such case, it's recommended to declare it as Public instead of Global.