problem in using global variables

rsfnoam

Registered User.
Local time
Today, 11:07
Joined
Aug 31, 2011
Messages
25
Hi there
Whatsup friends? long long time since the last time i was here..:)
well I have a problem that occured to be a big one for me but probably a "nothing" for you ..what can i do.
I have two fields on my MAIN form called fd and td..
I want to use them as global variables so that when the user enters a value in MAIN form i can use that value on rptform and othe forms..
So my question is how do i declare those fields as global and use them after in other forms..
Thanx alot in advance
Noam
 
These values entered in the form, are they stored in a table then? If so, don't enshrine them as global variables somewhere, but rather, retrieve the data from the table only if and when you need it using a process that makes it clear what is happening and why.

Or are these values more like system settings?
 
Hi
thanx for the reply
well you helped me alot but guess what.. I found out that what i forgot to do is to acually insert the values into the public variable..I declared a public module named:pubvar. But entered the 'explicit option" .. so what Ihad to do is :
pubvar.fd = clng(myfd)...and pubvar.td = clng(mytd) ..this solved that problem and now it works great..
so again
Thanx very very much for your help
Noam
 
Remember that if the main form is not closed you could add a simple function to get the value:
Public Function getFD() as Long
getFD=Forms("frm_Main").FD
End Function
 

Users who are viewing this thread

Back
Top Bottom