Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Why use text boxes as labels?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stapes - 22 Jan 2008 11:44 GMT
Hi

The guy I replaced in my current position used text boxes throughout
instead of labels on his forms. This makes it difficult when making
amendments, as all the field names in Design View just say Unbound. I
have been replacing them with Labels as I go, but am I missing
something?
Is there any good reason for doing this?

Stapes
Douglas J. Steele - 22 Jan 2008 12:02 GMT
I don't see why it should make things any more difficult, but then I always
rename all of my controls, giving them meaningful names.

I can't think of any strong reason why to use text boxes instead of labels,
though.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hi
>
[quoted text clipped - 6 lines]
>
> Stapes
Allen Browne - 22 Jan 2008 12:15 GMT
There's a couple of reasons why they might have done this.

a) If this is on Access 2003, and the controls are on a tab control:
   http://allenbrowne.com/ser-46.html
This issue was solved in SP3 for Office 2003.

b) If you need an expression, so the "caption" changes under different
conditions.

c) On a report if you want the controls to shrink.

d) 'coz the guy didn't know the difference between a text box and a label?
:o)

Signature

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.

> The guy I replaced in my current position used text boxes throughout
> instead of labels on his forms. This makes it difficult when making
[quoted text clipped - 4 lines]
>
> Stapes
Al Campagna - 22 Jan 2008 13:07 GMT
Stapes,
   Labels should be labels, and text controls should be text controls.
   I would imagine that because all those "caption" text controls are
actually calculated fields, they would add to the overhead on a form.
Probably not really noticeable though, unless there were a great many of
them.  It's not kosher, but also not a serious problem.

   But, your statement...
>> as all the field names in Design View just say Unbound
is very odd...  A text control used as a label would have something like
this in the ControlSource...
       = "This is the displayed text"
   In design view that control would show...
       = "This is the displayed text"
not "Unbound."   You should still be able to see what the control will
display when the form is run.

*** You must be sure that he has not coded some of these controls to change
their text during data entry on the form.  In that case, converting those
Text controls to Labels would cause the code to fail.

   Please show a couple of examples of the text controls... we may be
missing something here.
   And make sure that no Macros, or any VBCode address these values at
runtime.
Signature

   hth
   Al Campagna
   Microsoft Access MVP
   http://home.comcast.net/~cccsolutions/index.html

   "Find a job that you love... and you'll never work a day in your life."

> Hi
>
[quoted text clipped - 6 lines]
>
> Stapes
Bob Quintal - 22 Jan 2008 22:46 GMT
> Stapes,
>     Labels should be labels, and text controls should be text
[quoted text clipped - 27 lines]
>     values at
> runtime.

If the original coder set the values via code, and was ignorant of
the fact that one needs to specify the .caption property in code to
change a label's text, as opposed to a textbox not needing a
property specified, yhat coder may have used the textboxes instead
of the labels.

me.lbl01 = "This is some text" fails
me.txtl01 = "This is some text" works
me.lbl01.caption = "This is some text" works

I've encountered several applications where the coders used
textboxes simply because they could not find how to change a label.

Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Al Campagna - 23 Jan 2008 01:07 GMT
Bob,
  Good points.  I never thought of leaving all text controls blank, and
coding to set values on form open...

   Al Campagna
   Microsoft Access MVP
   http://home.comcast.net/~cccsolutions/index.html

   "Find a job that you love... and you'll never work a day in your life."

>> Stapes,
>>     Labels should be labels, and text controls should be text
[quoted text clipped - 40 lines]
> I've encountered several applications where the coders used
> textboxes simply because they could not find how to change a label.
Bob Quintal - 23 Jan 2008 02:22 GMT
> Bob,
>    Good points.  I never thought of leaving all text controls
>    blank, and
> coding to set values on form open...

It's about the only way to have a multi-lingual application, that
you can change languages at any time.. You'd set up a table with the
relevant form name textboxId, language ID and label text. Code in
the form load event retrieves the relevant strings and populates the
form text.  

>     Al Campagna
>     Microsoft Access MVP
>     http://home.comcast.net/~cccsolutions/index.html
>
>     "Find a job that you love... and you'll never work a day in
>     your life."

My boss  claims I haven't worked a day in the 30 years I've been
with the company. Based on the above, he's right.

Q

>>> Stapes,
>>>     Labels should be labels, and text controls should be text
[quoted text clipped - 41 lines]
>> textboxes simply because they could not find how to change a
>> label.

Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Al Campagna - 23 Jan 2008 13:27 GMT
Bob,
  Good point about the language dependency.  Here in New Hampshire it would
be...
       PahtNumbah = ACW1251       :-D
Signature

   Al Campagna
   Microsoft Access MVP
   http://home.comcast.net/~cccsolutions/index.html

   "Find a job that you love... and you'll never work a day in your life."

>> Bob,
>>    Good points.  I never thought of leaving all text controls
[quoted text clipped - 64 lines]
>>> textboxes simply because they could not find how to change a
>>> label.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.