For a research study I'm writing a form to screen possible subjects based on various criteria stored in a table. The table essentially has three columns: field_name, Criteria_short, and Criteria_long. The form is pretty busy so there is only space for the short description of the field.
e.g. "No history of coronary artery disease."
I want to include an OnClick or OnGotFocus event for each checkbox field that changes a textbox to show the long description of the criteria.
e.g. "No coronary artery disease within 5years, evidence by cath procedure, stress test, ECG . . . "
Problem 1: the tool-tip-text property isn't big enough to hold the long descriptions.
Problem 2: I plan on using the same code for other studies with different criteria. I have code that iterates through each criteria in a table that creates a checkbox with the appropriate short description. I don't want to 'hard code' each event procedure for each text box (about 50 criteria). As I iterate through each criteria I want to set the OnClick event procedure to set some text box to the long description. The following do not work:
It seems that I can only set the event property to built in functions.
How can I generate the event procedures with a for loop?
e.g. "No history of coronary artery disease."
I want to include an OnClick or OnGotFocus event for each checkbox field that changes a textbox to show the long description of the criteria.
e.g. "No coronary artery disease within 5years, evidence by cath procedure, stress test, ECG . . . "
Problem 1: the tool-tip-text property isn't big enough to hold the long descriptions.
Problem 2: I plan on using the same code for other studies with different criteria. I have code that iterates through each criteria in a table that creates a checkbox with the appropriate short description. I don't want to 'hard code' each event procedure for each text box (about 50 criteria). As I iterate through each criteria I want to set the OnClick event procedure to set some text box to the long description. The following do not work:
Code:
For Each cont In Me.Controls
If cont.ControlType = acCheckBox Then
'assume that long_desc is the appropriate long description text
'directly update the textbox
cont.OnGotFocus = "= SomeTextBox = '"& long_desc &"'"
'use a function to update the textbox
cont.OnGotFocus = "= SomePublicFunction('"& long_desc &"')"
end if
next cont
How can I generate the event procedures with a for loop?