Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't display Public Variable 1

Status
Not open for further replies.

alr0

Programmer
May 9, 2001
211
US
Hi All,

I have an application that does some extensive calculations on open that can take up to 20 minutes for a 2 gig file. Rather than opening the main form, I have created a modular, popup that gives users the choice of a normal opening or to supress the calculations. Things seem to be working except for one...

The new opening form has a text box with the following control source:

="The size of this file is " & FlSz

FlSz (FileSize) is used in the code as expected but I cannot seem to display the variable. It is declared as a Public variable in a named module. I tried adding that to the variable name (basNewClm7BrCd!FlSz) and the display still shows: "#Name?"

If I insert a code break, FlSz is available in the immediate window or by hovering in the code.

So, as usual, I did all of the hard stuff, the file system object is producing the file size and users can choose to bypass the calculations but for some (simple?) reason I can't seem to display the same variable that is working in the code.

Thanks in advance for any insights,

alr

_____________________________________
If a large part of intelligence is the ability to generalize, it is ironic that a large part of what we call wisdom is the ability not to generalize.
 
Create a public function in basNewClm7BrCd like this:
Public Function getFlSz()
getFlSz = FlSz
End Function

and now the control source:
="The size of this file is " & getFlSz()

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PH,

How could I have survived without the obvious?

Thanks! First time, it was simple.

alr

_____________________________________
If a large part of intelligence is the ability to generalize, it is ironic that a large part of what we call wisdom is the ability not to generalize.
 
Or even simpler:

Code:
Private Sub Form_Load()
     Me.YourTextBox = "File size is " & FlSz
End Sub

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top