HELP: how to locate objects on userform from VBA code

S

sam

Hi All,

How do I locate objects on userform based on the VBA code?

For eg: I have some events like StudentYes_Click and StudentNo_Click in the
VBAProject and there is some code in those events. I tried Debug --> Compile
but didnt get any compile errors. So I am assuming I have those two radio
buttons somewhere on the userform, But I am not able to find them.

Is there a way to resolve this? how do I find those two radio buttons?

Thanks in advance
 
G

Gary Brown

In the Visual Basic Editor (VBE), open the form.
Select F4 to view the Propeties Window.
Left-click anywhere within the form.
The Properties Window will show the name of the object you clicked on in the
form.
Now, open the Dropdown in the Properties Window next to the name of the
object you clicked on. Search for 'Student_Yes' and 'StudentNO'. Click on
one of them. It will be highlighted on the form.
 
J

john

sam,
see if this helps.

code goes behind your form

Dim ctl As Control

For Each ctl In Me.Controls

ctl.Visible = True

MsgBox ctl.Name

Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top