[AccessD] Programmatically dissociate label from its parent control

John W. Colby jwcolby at gmail.com
Mon Jul 27 12:07:50 CDT 2015


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



More information about the AccessD mailing list