Hi all,
I would greatly appreciate some guidance on this if you are so inclined. I have researched the issue and am unable to find a write-up. I don't know if what I am attempting is even possible.
I am preparing an evaluation form with checkboxes for the different items to be considered. When a checkbox is selected, I would then like for a textbox to appear which is uniquely tied to that specifically selected checkbox. That textbox would be pre-populated with text that explains more about whatever checkbox was selected.
The form, upon completion, will be used in a final report that hides all unselected checkboxes (and their respective textboxes).
As an example of the practical application:
Checkbox "cbTomatoes" is selected by the user.
Texbox "tbTomatoes" would then become visible on the form and subject to being printed as a Memo (or help file, etc.), and provide the following explanation "There are many varieties of cultivated tomatoes. One popular variety is Beefsteak tomato which on average weighs 1 pound. Blah, blah, blah..."
Here is some example code which is not working and yields an error message:
=====================
Private Sub cbTomatoes_Click()
If Me.cbTomatoes = -1 Then
Me.tbTomatoes.Visible = True
Else
Me.tbTomatoes.Visible = False
Me.cbTomatoes.Value = Null
End If
Private Sub Other_AfterUpdate()
If Me.cbTomatoes = -1 Then
Me.tbTomatoes.Visible = True
Else
Me.tbTomatoes.Visible = False
Me.cbTomatoes.Value = Null
End If
End Sub
=====================
The error message reads as follows:
The expression On Click you entered as the event property setting produced the following error: Invalid outside procedure. *The expression may not result in the name of the macro, the name of the user-defined function, or [Event Procedure]. *There may have been an error evaluating the function, event, or macro.
I am not using a macro. As for the event (On Click or After Update), when I use Code Builder, upon saving that code Access automatically populates the respective event with [Event Procedure], so the error message is confusing in that regard.
System: Win10, Access 2007
Many thanks for any assistance you might provide.
I would greatly appreciate some guidance on this if you are so inclined. I have researched the issue and am unable to find a write-up. I don't know if what I am attempting is even possible.
I am preparing an evaluation form with checkboxes for the different items to be considered. When a checkbox is selected, I would then like for a textbox to appear which is uniquely tied to that specifically selected checkbox. That textbox would be pre-populated with text that explains more about whatever checkbox was selected.
The form, upon completion, will be used in a final report that hides all unselected checkboxes (and their respective textboxes).
As an example of the practical application:
Checkbox "cbTomatoes" is selected by the user.
Texbox "tbTomatoes" would then become visible on the form and subject to being printed as a Memo (or help file, etc.), and provide the following explanation "There are many varieties of cultivated tomatoes. One popular variety is Beefsteak tomato which on average weighs 1 pound. Blah, blah, blah..."
Here is some example code which is not working and yields an error message:
=====================
Private Sub cbTomatoes_Click()
If Me.cbTomatoes = -1 Then
Me.tbTomatoes.Visible = True
Else
Me.tbTomatoes.Visible = False
Me.cbTomatoes.Value = Null
End If
Private Sub Other_AfterUpdate()
If Me.cbTomatoes = -1 Then
Me.tbTomatoes.Visible = True
Else
Me.tbTomatoes.Visible = False
Me.cbTomatoes.Value = Null
End If
End Sub
=====================
The error message reads as follows:
The expression On Click you entered as the event property setting produced the following error: Invalid outside procedure. *The expression may not result in the name of the macro, the name of the user-defined function, or [Event Procedure]. *There may have been an error evaluating the function, event, or macro.
I am not using a macro. As for the event (On Click or After Update), when I use Code Builder, upon saving that code Access automatically populates the respective event with [Event Procedure], so the error message is confusing in that regard.
System: Win10, Access 2007
Many thanks for any assistance you might provide.