Re: Hiding a field from a sub form.

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Fri, 18 May 2007 14:50:00 -0700, TheNovice
<TheNovice@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I know that this looks easy (and it probably is) but this is what I need to do.

I have this code that I can hide a field within the same form

' NI.Visible = Not NB

And this works just fine.

what I would like to do is Hide a Field from a Sub Form and I am hitting a
wall.

I tried this, so please tell me where I am brain dead.

frmDateEntry!product.visible = not NB

Referring to a Subform is a bit tricky. The subform is not part of the Forms
collection, as it's not open in its own right; you need to navigate to it from
the mainform, via the Name property *of the Subform control* container - which
might or might not be the same as the name of the form within that container.

For code on the mainform, it would be

Me!subformname.Form!product.Visible = <whatever>

If the code is in the subform, then you can just use

Me!product.Visible = ...

John W. Vinson [MVP]
.



Relevant Pages

  • Re: Not in List problem
    ... > It is not adding the new item, 4 instance, if I add a new container no eg ... > Hinesight though, I have never used it on a subform, only a parent/main. ... >> What's the problem you're encountering? ... >>> Mark ...
    (microsoft.public.access.formscoding)
  • Re: Path to field on subform within a tabbed form
    ... Dim frm As Access.Form ... Set ctl = Me!LocationSub ... of your subform container you put ...
    (microsoft.public.access.queries)
  • Re: Test form for read only
    ... the subform, which is okay, but a lot of times it isn't and in this case you ... if your container is actually named Ship History subform then you can ... the problem is that I'm trying to determine what the AllowEdits property ... I have a form with a button to toggle back and forth between "Edit" ...
    (microsoft.public.access.formscoding)
  • Re: Requerying combo box in sub sub form
    ... You refer to controls on a subform using this syntax: ... So you can use that as the <container form object> to get down to a lower ... Subform1 and Subform2 are the names of the subform container ...
    (microsoft.public.access.formscoding)
  • Re: Not in List problem
    ... It is not adding the new item, 4 instance, if I add a new container no eg ... Hinesight though, I have never used it on a subform, only a parent/main. ... >> Private Sub cmbContainer_NotInList(NewData As String, Response As ...
    (microsoft.public.access.formscoding)