Visible property on another form

cpampas

Registered User.
Local time
Today, 06:22
Joined
Jul 23, 2012
Messages
221
Inside of form "frmMain", I have two forms :
frmSearch
frmList

from a button in frmSearch, I want to change the visible property of controls in frmList
I tried the following, wich wont work

Code:
If curr = 1 Then
     Forms!frmList.debitoPH.Visible = False
     Forms!frmList.Debito.Visible = True
Else
     Forms!frmList.debitoPH.Visible = true
     Forms!frmList.Debito.Visible = false
End If

Any thoughts on what I am doing wrong
Thanks
 
you cannot refer to a subform by its name, since you could have many instances of a subform. You need to reference through the subform control.

me.SubformControlList.Form.debitoPh.visible = false
where SubformControlList is your actual name of the subform control and not necessarily the name of the form inside the subform control. By default the two names are the same, but not always.

or in this case
me.SubformControlList.Form.debittoPh.visible = (curr<> 1)
me.subformControlist.form.debitTo.visible = (curr = 1)
 
That worked, thanks
 

Users who are viewing this thread

Back
Top Bottom