View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default VBA passing information between differnt User Forms

It would be far simpler to create the flag variable as a Public variable in
a general code module, you will then be able to load and read it from either
form.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"chfa" wrote in message
ups.com...
Hi u,

the task is as following :

When User Form1 (UF1) is called, it checks for a value in a Sheet. If
the value isn't set UF1 croaks and sets a flag to be passed to a
UserForm (UF2) where the value is to be set.

Searching 4 the solution I found Public Properties the most suitable
way solving my task. But i didn't got the string yet. In UF2 the
flagRogue keeps empty.

Due to what I found I tried following:

in: UF1
'---------------
private flagRogue as string
publicproperty get flagStatus() as String
flagStatus = flagCroak
end property
publicproperty let flagStatus(byval flagVal as String)
flagStatus = flagRogue
end property
'--------------
' Initialize:
dim wannaSthg as new UF2
..
if <no Value Then
<croak
flagRogue = 1
wannaSthg.flagRogue = Me.flagRogue
wannaSthg.Show
end if


in UF2
'-------------
private flagRogue as string
publicproperty get flagStatus() as String
flagStatus = flagCroak
end property
publicproperty let flagStatus(byval flagVal as String)
flagStatus = flagRogue
end property
'--------------
' Initialize:
dim wannaSthg as new UF2
..
if flagRogue Then
<do something
else
<do something else
end if

Question:
Where I'm wrong ???

thanx 4 helping
VBR