[AccessD] Programmatically dissociate label from its parent control

Stuart McLachlan stuart at lexacorp.com.pg
Mon Jul 27 16:50:21 CDT 2015


Hmm, JC back on the Access list after a long absence!

Wassap John, taking a break from boat systems for a while?  :-)

-- 
Stuart

On 27 Jul 2015 at 13:07, John W. Colby wrote:

> Each control has a .Controls collection, as does the form itself. The
> label is always Controls(0), the "zeroth" item in the collection.
> 
> 
> You have to get a pointer to the current form.
> 
> dim ctl as control
> So for each ctl in frm.Controls
>      ctl.controls(0) = null
> next ctl
> 
> I don't remember whether this can be done at run time or whether you
> have to do this in design mode and save the form.
> 
> I THINK it can be done at runtime.
> 
> John W. Colby
> 
> On 7/27/2015 12:35 PM, Bill Benson wrote:
> > Anyone know a way to do this? I almost never like labels clinging to
> > controls when the parent controls are added. This happens en masse
> > when dragging fields onto a fresh form, and I have to select the
> > labels one by one and cut/paste, reposition them, which is a
> > nuissance.
> >
> > If there is a way to shut off the label feature entirely that might
> > be an adequate half-measure, but what I would really prefer is a way
> > to loop controls and dissociate them from the parent controls they
> > may be clinging to without having to eliminate them entirely (were
> > that even possible).
> >
> > Bill
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list