Hide two fields/columns on a subform

G

Guest

Using Office 2003 and Windows XP;

I have a subform on a main form. The subform is unbound and is populated
using a SQL string fed to the control source.

I would like to hide two of the fields or columns on the subform so when the
main form is opened, these two fields do not appear.

I set their properties to Visible = No and Display When = Print Only; but
they still show up. How can I make them disappear to the user, yet still be
available to me?

Thanks a lot for your assistance.
 
J

John Vinson

Using Office 2003 and Windows XP;

I have a subform on a main form. The subform is unbound and is populated
using a SQL string fed to the control source.

That sentence is self-contradictory, or I'm completely
misunderstanding it. A Subform doesn't HAVE a control source - it has
a Recordsource; if that Recordsource is a SQL string, then it *is*
bound. Could you explain what you mean by "populated using a SQL
string..."?
I would like to hide two of the fields or columns on the subform so when the
main form is opened, these two fields do not appear.

Simply don't put controls on the Form for those fields then.
I set their properties to Visible = No and Display When = Print Only; but
they still show up. How can I make them disappear to the user, yet still be
available to me?

Again... not clear what you're saying. You want the controls to be
simultaneously visible and not visible...??

If you're assuming that a Subform must be a Datasheet - revise your
assumption. You may be able to get the effect you want by using a
Continuous Form bound to the query defined by your SQL string. You can
then make *controls* on the form visible or not as you wish, or
included on the Form or not, whatever fields the underlying query
contains.

John W. Vinson[MVP]
 
R

Ron2006

That sentence is self-contradictory, or I'm completely
misunderstanding it. A Subform doesn't HAVE a control source - it has
a Recordsource; if that Recordsource is a SQL string, then it *is*
bound. Could you explain what you mean by "populated using a SQL
string..."?


Simply don't put controls on the Form for those fields then.


Again... not clear what you're saying. You want the controls to be
simultaneously visible and not visible...??

If you're assuming that a Subform must be a Datasheet - revise your
assumption. You may be able to get the effect you want by using a
Continuous Form bound to the query defined by your SQL string. You can
then make *controls* on the form visible or not as you wish, or
included on the Form or not, whatever fields the underlying query
contains.

John W. Vinson[MVP]

in a Datasheet view:
fieldname.columnwidth = 0 will sort of hide the fields

But, unless you hide a bunch of the menu items someone can find them
and make them visible


In a continuous form view what John suggested will work IF you have
some way of determining whether to show them .

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top