Combobox Dropdown and Continuous Form Arrow Keys

D

DanDan

I'm still using Access 2000 here so bear with me. On my continuous forms, the
up and down arrow keys send me to the controls left and right of the current
control instead of to the next or previous record for the same control. I
solved the problem by intercepting the keydown event for the up and down
arrow keys on each control for the continuous form. My problem is now that my
comboboxes can't move through records in the dropdown list using the
arrowkeys - is there any way I could have a condition in the keydown event
that checks if the control is in the dropdown state? Or is there a better
workaround for the continuous form arrow key problem
 
A

Allen Browne

You could test Screen.ActiveControl.ControlType (or
Me.ActiveControl.ControlType in code) to see if it is acComboBox, and if so,
don't execute your custom code, so the keystroke behaves as normal.

If you want to do that only if the combo is dropped down, you will need
something like this to determine its state:
http://www.mvps.org/access/api/api0052.htm
 
A

AccessVandal via AccessMonster.com

Would it be better that you use the datasheet view? Why need to check the
combobox dropdown state? I don't think there's any state that is possible to
monitor the dropdown condition. Anyone?
 
D

DanDan

Thanks a bunch Allen - so often I have to settle for a not quite right look
and feel because these little gremlins creep in but after placing the code (I
used the first solution by Dev Ashish) verbatim into its own module I added
'If fIsComboOpen = True Then Exit Sub' to the first line of my keydown event
on all my comboboxes and now the form looks and feels right
 

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