View Full Version : Global Variables


reedp
10-18-2001, 03:14 AM
Seems a trivial question, but how does noe create a global variable (eg exchange rate in a financial system) that is visible to all forms? I have tried with "Public" but I can't seem to get it to work

Thanks in advance

Phil
PAris

Rich
10-18-2001, 04:02 AM
Create a new module
Option Compare Database
Option Explicit

Public MyName As String
Public MyVal As Integer
save with a meaningful name.
To refer to it in a form module say
Me.Somefield = MyName