Displaying Field Description in a form Label

Cowboy_BeBa

Registered User.
Local time
Today, 16:48
Joined
Nov 30, 2010
Messages
188
Hi

Im working on a big DB, going to need to write up a manual at some point, but im also thinking its a good idea to have instructions displayed internally, to save users the time of looking some things up in the Manual

Im building the back end atm, making sure to write detailed descriptions in the table design, just wondering if theres any way to get the description and display it in a form label (lblDetails) when a field is selected/active (ie, user is about to type in it) or when they hover over it with the mouse cursor?

Cheers,
Ben
 
if textbox is selected/active, you can use it's ongotfocus event to show description on a label control:

private sub textbox_gotfocus()
me.label.caption = "caption here"
end sub

private sub textbox_lostfocus()
me.label.caption = ""
end sub
 
if textbox is selected/active, you can use it's ongotfocus event to show description on a label control:

private sub textbox_gotfocus()
me.label.caption = "caption here"
end sub

private sub textbox_lostfocus()
me.label.caption = ""
end sub

thanks dude
that helps but its the "caption here" part that im having trouble with
what i wanna do is get the info ive written in the Description field of the table design view there instead (without manually copy/pasting every field from every table in the db)

is there a way to get that info?
 
you can just use the controltip text (see control properties>other) which will appear when a user hovers over the control.

Alternatively, if you want to assign this to a label, you would use something like this in your control gotfocus event

Code:
 on error resume next 'otherwise code will fail if there is no description
 labelnamehere.Caption = CurrentDb.TableDefs("tablenamehere").Fields("fieldnamehere").Properties("Description")
 
you can also use recordset to display the description:

private sub textbox_gotfocus()
me.label.caption = Me.recordsetclone("ControlSourceName").Properties("Description")
end sub

controlsourcename is the name of the bound field.
 

Users who are viewing this thread

Back
Top Bottom