|
-
May 23rd, 2001, 02:23 AM
#1
Thread Starter
Lively Member
Passing values between forms
Hi Folks
Anyone know the best way to pass alues between forms?
Im trying to avoid using Globals.
Cheers
-
May 23rd, 2001, 02:27 AM
#2
Member
why are you trying to avoid using globals?
Matt Bradbury
An optimist will claim the glass is half full.
A pessimist that it is half empty.
I just think the glass is too big.
-
May 23rd, 2001, 02:30 AM
#3
Thread Starter
Lively Member
Ive created an App and now it has to be made comply to company standards
-
May 23rd, 2001, 02:35 AM
#4
Member
and company standards say that you can't use global variables?
Matt Bradbury
An optimist will claim the glass is half full.
A pessimist that it is half empty.
I just think the glass is too big.
-
May 23rd, 2001, 02:41 AM
#5
Thread Starter
Lively Member
-
May 23rd, 2001, 02:43 AM
#6
Addicted Member
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!!
-
May 23rd, 2001, 02:47 AM
#7
Thread Starter
Lively Member
Cheers Sanj
But If I put the shared variables in a module, do I not have to make the sjhared variables global anyway?
-
May 23rd, 2001, 02:51 AM
#8
-
May 23rd, 2001, 02:57 AM
#9
Thread Starter
Lively Member
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
-
May 23rd, 2001, 03:05 AM
#10
Addicted Member
hi mick
Just to verify; You explicitly place 'Global' before the shared variables in your modules?
the answer is no...well i dont anyway!!
i use the keyword Public
This is what i extracted from the help
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.
would that be OK for u to Use
-
May 23rd, 2001, 03:10 AM
#11
Thread Starter
Lively Member
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
-
May 23rd, 2001, 03:11 AM
#12
Addicted Member
-
May 23rd, 2001, 03:12 AM
#13
Thread Starter
Lively Member
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
-
May 23rd, 2001, 03:14 AM
#14
Addicted Member
glad we got round it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|