Customize field labels on a Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to set the label of a field programmatically in Access 2003?
I am building a Baseball statistics database and would like the label of my
'Opponent Score' (Number) field to take on the value of the 'Opponent Name'
(Text) field. Is this possible?
 
your code line will look something like
Me.lblTemp.Caption = Me.txtTemp.Value

Depending on where txtTemp is populated, will depend on where you need to
put the code (what event).
 
Hi James,

Do you happen to know of a way to use a variation of the code below to
capture the 'Unbound' column of a Combo Box? I have a combo box that is set
to store a team number, but display the team's name on the Form. I want the
code below to be able to grab the unbound column (but displayed on form) and
make the label of another field on the form to take on that value. Is it
possible to use the unbound column of a combo box in this fashion?
 
Hi James,

Do you happen to know of a way to use a variation of the code below to
capture the 'Unbound' column of a Combo Box? I have a combo box that is set
to store a team number, but display the team's name on the Form. I want the
code below to be able to grab the unbound column (but displayed on form) and
make the label of another field on the form to take on that value. Is it
possible to use the unbound column of a combo box in this fashion?

A Combo Box has a Column property: it's a zero based number, the position of
the field in the combo's Rowsource.

That is, if a Combo is based on a query with five fields, and its ColumnCount
is 5, you can refer to the fifth field in the query (whether it's the bound
column or an unbound one) with

=comboboxname.Column(4)


John W. Vinson [MVP]
 
Hi John,

A follow-up question. Is there a way to automatically re-size the field
label that I am now successfully populating to the value of the combo box to
enlarge or shrink to the size of the team name that shows in the field label
now?
 
A follow-up question. Is there a way to automatically re-size the field
label that I am now successfully populating to the value of the combo box to
enlarge or shrink to the size of the team name that shows in the field label
now?

Not at all easily. Since different fonts have different sizes - even if they
are all (say) 9 point - it can be a real challenge to figure out how many
twips wide a textbox must be to contain a particular text string. I'd just
make the label or textbox big enough for the longest team name.

John W. Vinson [MVP]
 
Thanks, John!
--
Pat Dools


John W. Vinson said:
Not at all easily. Since different fonts have different sizes - even if they
are all (say) 9 point - it can be a real challenge to figure out how many
twips wide a textbox must be to contain a particular text string. I'd just
make the label or textbox big enough for the longest team name.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top