Hiding a field from a sub form.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Thanks in advance,
 
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]
 
Thanks John,

I tried it and it still seems to give me a Run-Time Error '2465': that it
cannot find the field 'frmDateEntry'.

Any Ideas as to why??

Thanks,
--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.
 
Thanks John,

I tried it and it still seems to give me a Run-Time Error '2465': that it
cannot find the field 'frmDateEntry'.

Any Ideas as to why??

I presume because there is no field named frmDateEntry, or - more likely -
there is an error in your code.

Care to post the code so we can help debug it?

John W. Vinson [MVP]
 
Back
Top