See How to: Control the Availability of a Variable (Visual Basic)
and samples from Google, like Global Variables in Visual Basic .NET
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
First off I'm a beginner programmer with little schooling to date, but that's changing soon. Anyway, I'm working on a personal project at current time and I'm trying to declare some global variables to be used across multiple forms(restaurant management application) buy I can't seem to get them to work. I've put them in a module bug I don't knowvif I'm calling them correctly. I use I use Public variable As Datatype in the module.
See How to: Control the Availability of a Variable (Visual Basic)
and samples from Google, like Global Variables in Visual Basic .NET
Hi @Chris Milam ,
You can use Public only at module, interface, or namespace level. This means the declaration context for a Public element must be a source file, namespace, interface, module, class, or structure, and cannot be a procedure.
You can refer to this documentation Public (Visual Basic)
Best Regards.
Jiachen Li
----------
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.