|
-
May 17th, 2004, 12:12 PM
#1
Thread Starter
Lively Member
Passing public property
Hi All:
I created a public property on my form3. The property I created is called lVisible. I assigned "F' to this property from Form2. Like so: Form3.lVisible = "F". Than I call form3 like so:
Load Form3
Form3.Show 1
If my form3, I have some code like so:
Private Sub Form_Activate()
If Me.lVisible = F Then
txtbxaddr2.Visible = False
End If
txtPerson.SetFocus
End Sub
The lVisible property in Form3 is null, even though I am setting the value to "F" in form. What am I doing wrong?
Thanks
-
May 17th, 2004, 12:27 PM
#2
Try loading it first then setting the property, then showing it.
VB Code:
Load Form3
Form3.lVisible = "F"
Form3.Show 1
TG
-
May 17th, 2004, 12:44 PM
#3
Thread Starter
Lively Member
Still the value of lVisible is emtpy. What do I do next?
-
May 17th, 2004, 02:12 PM
#4
Thread Starter
Lively Member
Public variable
Hi:
I still need some help on setting a value on a public property.
I created a public property on form 3 the property is called lVisible.
Before I call form3 this is what I do:
Private Sub cmdaddpersoncollect_Click()
Form2.Hide
Load Form3
Form3.lVisible = "F"
Form3.txtPerson.Text = RTrim(ComboPrsTicket.Text)
Form3.Show 1
End Sub
In Form3, the lVisible is empty. What do I need to do in order to save the value I store in lVisible in Form2?
Thanks
-
May 17th, 2004, 03:01 PM
#5
What does the code behind your property look like?
TG
-
May 17th, 2004, 03:29 PM
#6
Thread Starter
Lively Member
Public variable
I do not have any code behind the property.
Public Property Get lVisible() As Variant
End Property
Public Property Let lVisible(ByVal vNewValue As Variant)
End Property
What code should I add behind the property?
-
May 17th, 2004, 03:35 PM
#7
OK,..... now the source of the problem has been exposed. You've created the property, but not told it where to hold the data.
VB Code:
dim mvarIVisible as Variant
Public Property Get lVisible() As Variant
IVisible = mvarIVisible
End Property
Public Property Let lVisible(ByVal vNewValue As Variant)
mvarIVisible = vNewValue
End Property
And you really should type case the property (and the related variable) to a specific type.
TG
-
May 17th, 2004, 03:50 PM
#8
Thread Starter
Lively Member
Public variable
Thank you very much that was 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
|