Patrick O'Dea
asked on
Automating my help text for a datasheet
following on from an earlier question ....
This code is used in every field in my datasheet and displays "help" text that is held in the "tag".
I would like to automate a little further as follows;
1. Setup a new tblHelpUsers with two fields ; [Control_Name], [HelpText]
2. So, when the control is in focus I simple call a function "DisplayHelp"
3. The function will KNOW the controlname and set my Me.Parent.HelpTextForField to [tblHelpUsers].[HelpText] as per the original VBA
4. Obviously I will no longer use the "tag" to hold help text.
What line should I put in my function to achieve the above?
Al contributions appreciated.
Private Sub SellingPrice_GotFocus()
Me.Parent.HelpTextForField = Me.SellingPrice.Tag
End Sub
This code is used in every field in my datasheet and displays "help" text that is held in the "tag".
I would like to automate a little further as follows;
1. Setup a new tblHelpUsers with two fields ; [Control_Name], [HelpText]
2. So, when the control is in focus I simple call a function "DisplayHelp"
3. The function will KNOW the controlname and set my Me.Parent.HelpTextForField
4. Obviously I will no longer use the "tag" to hold help text.
What line should I put in my function to achieve the above?
Al contributions appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it ;
Screen.ActiveControl.Name
Screen.ActiveControl.Name
ASKER
Thanks folks,
That works perfectly!
(Comments noted, Pat)
That works perfectly!
(Comments noted, Pat)
ASKER
Your suggestion is work well ... but ...
Me.Name is displaying the form name (I want the control name)
I suspect that this may be because my datasheet is held as a subfolder within another folder.
QUESTION: Is there a better way to reference the actual control?