Re: Reference a field labels caption?



If the control has an attached label, you can read its caption as:
ctl.Controls(0).Caption

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Rico" <r c o l l e n s @ h e m m i n g w a y . c o mREMOVE THIS PART IN
CAPS> wrote in message
news:Yc9Af.409363$ki.298102@xxxxxxxxxxx
> Hello,
>
> I'm looping through controls on a form, focusing on text boxes. If the
> field is null and I'd like to throw a pop up letting the user know that
> this "required" textbox is not filled out. If I show the user
> "control.controlname" then I get the txtThisIsMyField and it doesn't help
> the user much. I'd like to reference caption of the fields bound label.
> Is there any way of doing that?


.



Relevant Pages

  • Re: How to abbreviate long label control caption?
    ... >>I set the .Caption property of a label control dynamically during runtime. ... > http://www.mvps.org/vbvision/ If you wish to have the ellipsis at ...
    (microsoft.public.vb.controls)
  • Re: Determining hidden key values with the Repeater control
    ... Microsoft MVP ... It is not available on client. ... have the control to send it back. ... client-side visibility isn't needed for the Label. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Enumerating Option Group Controls
    ... Once you have the reference to the control, ... If you are trying to do this for the Caption of the Label of the option ... >> Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Updating Properties of a Control on a Worksheet
    ... Works for me if you using worksheet form control labels. ... For activeX objects you can get the caption as you would on a UserForm ... I created a test sub to cycle through the Sheet Label ...
    (microsoft.public.excel.programming)
  • Re: Changing datasheet column titles on the fly?
    ... take a look at the Caption property of the ... Label attached to each control. ... matches the Caption of the attached label. ...
    (microsoft.public.access.formscoding)

Loading