473,385 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Reference a field labels caption?

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?

Thanks!
Jan 20 '06 #1
2 4397
Rico wrote in message <Yc9Af.409363$ki.298102@pd7tw2no> :
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?

Thanks!


To reach the caption of an attached label, try some of the following
air code

for each ctl in me.controls
if <some condition> then
if ctl.controls.count > 0 then
' to ensure there is an attached label
msgbox ctl.controls(0).caption
else
msgbox ctl.name
end if
end if
next ctl

--
Roy-Vidar
Jan 20 '06 #2
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@pd7tw2no...
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?

Jan 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jared | last post by:
Here is my situation. I have multiple labels on a form but only certain ones will become visible while using the form. Depending on which check box(s) you pick, on another form, determines the...
1
by: Jackson M via AccessMonster.com | last post by:
I have buttons name A thur Z - When I select say the letter "H" button I need my ProductName field to jump to the record that starts with the letter "H" and soforth. Can anyone help -- This...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
3
by: Galen Somerville | last post by:
In two different Form modules FFTcls.Currfrm = Me In FFTcls class module Dim CurrForm As System.Windows.Forms.Form Public WriteOnly Property Currfrm() As System.Windows.Forms.Form...
3
by: Mike | last post by:
Need some help with passing a label to a subroutine. I have a form with lots of checkboxes. When the form loads i have a procedure that runs to lookup values and check the appropriate boxes. If the...
3
by: maffonso | last post by:
Hi guys, I have built a cross reference query (columns is year). I would like to change the caption and adjust others things. The best way would be to wrap the query in a form, but soon 2007 will...
8
markryan57
by: markryan57 | last post by:
Greetings, I searched for this, but cannot find exaclty what I am looking for. I am trying to dynamically create labels on a form just before it opens. I am reading from a database, building the...
2
by: Kanashii | last post by:
First off - I want to thank all who respond / try to help out and even those who took a moment to read over my question. Please be patient as I am -very- new to VB in general and unfortunately...
3
by: dgardner | last post by:
I have a form with 10 controls. The control source for each control will change depending on what is selected on another form. I have named the controls txt1, txt2, txt3, etc. The labels are named...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.