Current section of the form

L

lan yu

How can I retrieve the current section of the form?

What I'm trying to do is let user navigate through records in a
listview with up and down arrow buttons. I catch KeyDown event on form.
My current procedure forces current record to go up and down even if
the up/down arrows are pressed in the fields outside of details section.
 
S

Stefan Hoffmann

hi,

lan yu write:
How can I retrieve the current section of the form?
Each Section object has a Controls collection. Try finding
Screen.ActiveControl in them.


mfG
--> stefan <--
 
L

lan yu

Dim ctrl As Control
Dim details_section As Boolean

For Each ctrl In Me.Section(acDetail).Controls
If ctrl.ControlName = Me.ActiveControl.ControlName Then
details_section = True
Exit For
End If
Next ctrl


Thanks to Stefan I got it working.
 

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