Bruce Lawrence wrote:
I have a textbox on a form that I want to use to display a public
variable.
How would I go about doing this? Could I use a label as well?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Use a public Function to read the variable:
Public myVariable As string
Public Function GetMyVariable() As String
GetMyVariable = myVariable
End Function
Set the TextBox's ControlSource to
=GetMyVariable()
To set a label's Caption you'd have to do something like this in the
Form's Open or Current event procedure:
Private Sub Form_Current()
Me!LabelName.Caption = myVariable
End Sub
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQnqQzIechKqOuFEgEQKVAwCghvF7RClQLc4nTiu8chU8AO hvw/0AoO43
x39OJE5RfqY3d4ufWAepFPLy
=vX/B
-----END PGP SIGNATURE-----