Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating event procedures in option groups

Status
Not open for further replies.

moles

Technical User
Jul 29, 2002
17
US
I am a fairly new user in access. I am creating a form with several option groups using check boxes. Basically the option box consists of a question and yes and no check boxes. The functionality I desire is when a user selects the "no" check box, a text box will appear for the user to type in more information. Currently I am using the event procedure got focus in the check box properties only. This is what my code looks like:

Private Sub Browser_error_No_GotFocus()


If Me.Browser_error_No = True Then
Me.OLP_Access_Err_Desc1 = True

End If


End Sub

where OLP_Access_Err_Desc1 is the text box I want to open.
Nothing happens when I select the no check box. Any suggestions
 
ok great.

Here is how you do it.
Create a textbox, name it Text2.
Right click on the Text2 textbox. Select PROPERTIES
Click on the FORMAT tab.
Set the VISIBLE property of NO. (3 rows down)

Create the "No" Checkbox, let's call it Check0
Right click on the "No" checkbox and select BUILD EVENT.
Select CODE BUILDER.

Insert this

Private Sub Check0_Click()
If Check0 = -1 Then
Text2.Visible = True
Else
Text2.Visible = False
End If
End Sub

This should work.
When the checkbox is clicked. The Textbox appears... when it is unchecked it disappears.

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top