enumerate selected controls in design view of an access form

G

Greg J

I am working on a project that requires me to be able to enumerate
through all the controls that may be selected (ie: showing their
selection handles) in a forms design view window. I have managed to
capture the active form and can iterate through all the controls on the

form but I want to be able to minimise the list to only the controls
with the selection handles are identified.

Any help would be greatly appreciated.


Greg J
 
M

Marshall Barton

Greg said:
I am working on a project that requires me to be able to enumerate
through all the controls that may be selected (ie: showing their
selection handles) in a forms design view window. I have managed to
capture the active form and can iterate through all the controls on the

form but I want to be able to minimise the list to only the controls
with the selection handles are identified.


There is no collection of selected controls to iterate
through. You will have to iterate through the form's (or
section's) Controls collection and check each control's
InSelection property

For Each ctl In Me.Controls
If ctl.InSelection Then
'do something
End If
Next ctl
 
G

Greg J

EXCELLENT, thanks for that. Its easy when you know where to look.

I was using a "Control" object (ie Dim ctl as Control) as there are
various types of controls on the form and couldnt find a that property.
However, just now I created a Textbox object and found the property
and the help text.

Thank you so much!
 

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