Hiding a textbox

S

sean_mcad

I dont really need to hide the textbox as much as I need everything below it
to move up when its blank.

I suspect I should be using a different control for this. Basically I have 4
databound texboxes but the one in the middle is often empty. So when its
empty I need everything below it to move up.

Help?
 
S

Steve

Go to design view and select the textbox. Open properties. Set the Can
Shrink property to Yes.

Steve
(e-mail address removed)
 
P

Peter Fletcher

You can easily hide a Control when it doesn't contain anything (assuming that
you also know that you are not going to want to put anything in it!) by
making its Visible property False in the Current Event. However, Forms don't
embody the same concept of 'above' and 'below' that Reports do and that can
Controls on them to grow and shrink according to their contents. The position
of a control on a Form is fixed by its Top and Left Properties, irrespective
of where any other Controls are.

If there are only a couple of Controls below the one that is often empty,
you could put code in the Current Event to move them up over it when there is
nothing in it, but this would be a bit of a kludge. You may just have to put
up with the empty textbox!
 
M

Marshall Barton

sean_mcad said:
I dont really need to hide the textbox as much as I need everything below it
to move up when its blank.

I suspect I should be using a different control for this. Basically I have 4
databound texboxes but the one in the middle is often empty. So when its
empty I need everything below it to move up.


If there is nothing next to it, just set it and its
section's CanShrink property to Yes.

If that doesn't work, please provide more details about
exactly what you have where in the report section.
 
P

Peter Fletcher

Assuming that you are working with a report, ignore my previous post. My mind
was on another problem and I was thinking Forms rather than Reports.
Marshall's message is on target.
 
S

sean_mcad

This did not solve the problem. Ok here are the details

3 texboxes stacked on each other.
each one databound.
middle one field record is blank

Result with or without CanShrink is the same which is

1st textbox shows with data
space where 2nd texbox would show data if it had some
3rd textbox shows data.

That space when the second field is empty is becoming a problem.

thanks
 
M

Marshall Barton

sean_mcad said:
This did not solve the problem. Ok here are the details

3 texboxes stacked on each other.
each one databound.
middle one field record is blank

Result with or without CanShrink is the same which is

1st textbox shows with data
space where 2nd texbox would show data if it had some
3rd textbox shows data.

That space when the second field is empty is becoming a problem.


Is there anything (e.g. a label or line) else in the same
horizontal band as the text box? If not, did you remember
to set the section's CanShrink too?

If you'd explain in more detail what you are trying to
accomplish with the three text boxes, maybe we can provide a
more useful reply.
 

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