Hi Folks
Anyone know the best way to pass alues between forms?
Im trying to avoid using Globals.
Cheers
Printable View
Hi Folks
Anyone know the best way to pass alues between forms?
Im trying to avoid using Globals.
Cheers
why are you trying to avoid using globals?
Ive created an App and now it has to be made comply to company standards
and company standards say that you can't use global variables?
Yes
hi
mormally in my apps if i have a lot of shaered variables then i put it in a modual all the forms can acesses however if u can not do that cus of ur companies coding standards then u can pass the cariables when u call ur subs or functions!!
Code:
Sub Add_Responce()
dim mystring as string
mystring = "Hello it Sanj"
call test(mystring)
end sub
Public Sub Test(ByVal Response As String)
msgbox Responce
end sub
how about sommit like that ...
btw abouve is not tested!!
Cheers Sanj
But If I put the shared variables in a module, do I not have to make the sjhared variables global anyway?
yep of course!! :eek:
how about that example i gave does the help towards a solution u need! :rolleyes:
can u gove me more info so i can help??
Sanj
Just to verify; You explicitly place 'Global' before the shared variables in your modules?
I use a lot of Active X objects between forms, which would not suit your above method
hi mick
the answer is no...well i dont anyway!!Quote:
Just to verify; You explicitly place 'Global' before the shared variables in your modules?
i use the keyword Public
This is what i extracted from the help
would that be OK for u to Use;)Quote:
Variables declared using the Public statement are available to all procedures in all modules in all applications unless Option Private Module is in effect; in which case, the variables are public only within theproject in which they reside.
Sanj
Thats bang on. I just want to avoid using the 'Global' type. Publics although they are essentially the same thing.
Cheers for your help Sanj
No probs mate
glad to be of assitance :D ;) :p :cool: :D ;)
What I meant to say Sanj is thet although Publics are essentially the same thing as Globals, they are allowed within the constraints of my comapany standards.
Cheers
glad we got round it
:D