I would like to display a field's description on a form. How would I accomplish this? For example, table name is tblbureau, field name is Counsel with a description 'General Counsel for the Defense', form name is frmCounsel. I'd like to use a control (textbox?) that displays the full description instead of using the default label for the field name. Thanks.
Asked
Active
Viewed 4,858 times
1
-
1See http://stackoverflow.com/a/12940245/77335 – HansUp Oct 25 '12 at 17:08
1 Answers
0
If you have used the form wizards to create the form, any descriptive text is added to the StatusBarText
propery. This is even true when you create a blank form and drag fields from the field list to the form. You can refer to this property for your message box, or just refer the user to the statusbar. You can also update the ControlTipText property with the StatusBarText property.
MsgBox Me.ATextBox.StatusBarText
Using the above will save coding to get the description:
Currentdb.TableDefs("atablename").Fields("afieldname").Properties("Description")
Note that the description property is not available for fields when you have not added a descrition, so the above would cause an error.

Fionnuala
- 90,370
- 7
- 114
- 152
-
Thanks for the help! I added this code to the Form's On Load event and the label now uses the description. Private Sub Form_Load() Me.[Admin-FailReqs_Label].Caption = Me.Recordset.Fields("Admin-FailReqs").Properties("Description") End Sub – Susan Jack Oct 25 '12 at 19:14