Lose view of a control when changing width in Form_On Open event

T

Tim

Have a box for background color, formatted to the Back in Design View, and
several labels on top in the Header section. The last two columns are not
visible unless a specific type of data is present. Works fine but I'd like
to make the box and title label smaller in Design View so that there isn't a
lot of blank background color showing when those column titles aren't
needed. It would just make the form look a little neater, sized to the
column labels present, instead of the big blank unused space.

Set the width of the box and title to a smaller size in Design View. Change
the Width property for each in the Form Open event when the data is present
but the box and title label no longer show on the form. The unmodified
column title labels are still there.

Any help appreciated.

Tim
 
J

Jeanette Cunningham

Hi Tim,
to change the width of a label, use code like this-->
Me.NameOfLabel.Width = 2.1 * 567

Replace NameOfLabel with the obvious.
Replace 2.1 with the width required.
567 is the conversion factor for cm to twips in Oz where I am.
Use 1440 convert inches to twips.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
T

Tim

Thanks for the reply. You're answer is spot on. I realized later that day
that I'd had a senior moment and that I was thinking in inches when the
property was wanting twips. Actually it appears I had two senior moments as
I forgot to notify the group that I'd figured out my problem. Sorry about
that.

Thanks again,
Tim
 

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