02.06.04
I need some help displaying a public variable on a form. The variable is
declared and initilazied in a module at startup (and declared Public). I
have verified this with a msgBox(dbprogram) call. When I try to display it
in the form in a text box I get a #Name? error instead. I was told I have to
write a function to display it. I wrote a public function in the startup
module to return the value of a given string variable. Below is the
declaration, the initialization and code for the function, and the way I
tried to display it.
Public dbprogram as string ' declared
dbprogram = "OMACS" initialized
The on enter code for frmSplash ' This is a splash screen for the program
Private Sub Form_Open(Cancel As Integer)
init_pub_const 'initializes the public variables
End Sub
txtProgramName is a text box, the Control Source reads:
=AcquireVarTxt(dbprogram)
The code for AcquireVarTxt() is
Public Function AcquireVarTxt(theVarStr As String) As String
Dim theVar As String
theVar = theVarStr
End Function
what am I doing wrong here.
Thanks Matt