如何使用向下箭头键在下拉框中滚动? [英] How can you use down arrow key to scroll in a drop box?

查看:259
本文介绍了如何使用向下箭头键在下拉框中滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个QTY字段和一个ITEM字段。用户在QTY字段中输入一个数字,然后在下一个字段上选中,并且在该字段的右侧有一个向下箭头,您单击该向下箭头以从下拉框中选择正确的项目。 QTY和ITEM的组合是主键(两个主键)。当我切换到ITEM字段并按向下箭头时,会弹出一个消息框,告诉我主键字段不能为空(我想它正试图进入下一个框而不是去通过下拉项目)。这有一个简单的解决方案吗?我想点击TAB键,DOWN KEY(多次通过下拉框),TAB键(进入下一个QTY字段)。谢谢!!


想念你的朋友们。实施新的数据库...将在1月份与我的下一个实施。 : - )

I have a QTY field and an ITEM field. User inputs a number into the QTY field, then tabs over the the next field and there''s a down arrow on the right hand side of the field that you click to choose the correct item from the drop box. The combination of the QTY and the ITEM is the primary key (two primary keys). When I tab over to the ITEM field and press the down arrow, a message box pops up telling me that a primary key field can''t be null (I suppose it''s trying to go down to the next box rather than going through the drop down items). Is there an easy fix for this? I want to hit TAB key, DOWN KEY (multiple times to get through the drop box), TAB key (to get to the next QTY field). Thanks!!

Missed you Bytes friends. Implementing the new DB...will be back in January with my next one. :-)

推荐答案

嗯....我认为可能需要将该功能编码到按键中。在VBA中组合框的事件。


如果你愿意,我可以为你拼凑一些东西。我鼓励你先为自己尝试一下。
Hmm .... I think you might need to code that functionality into the "key down" event of the combo box in VBA.

I could thow something together for you if you like. I encourage you to try it for youself first, though.


我只能通过输入QTY来复制你的问题,选中Item Combobox,然后再次 Tabbing ,正如你所说,试图进入下一个控制。如果你勾选到Combobox并使用鼠标下拉框,一切正常。


我做了什么,只是为了减少两次击中Tab并弹出错误的机会,就是在输入时自动下拉框:
I can only replicate your problem by entering a QTY, tabbing into the Item Combobox, then Tabbing again, which is, as you said, trying to go to the next control. If you tab into the Combobox and use the mouse to drop down the box, everything works fine.

What I''d do, simply to decrease the chance of hitting Tab twice and popping the error, would be to automatically drop down the box when entering it:
展开 | 选择 | Wrap | 行号


好的,我打算采取Delerna的方法并尝试自己想出一些东西....但我想我我不得不要求提示。你需要一本好的VBA书来了解GotFocus()的含义吗?我的Access书有一章关于VBA ......但是我需要列出所有命令....更深入的内容。


我还没有有机会尝试你的想法Linq,但看起来这是我想去的确切方向。
Ok, I was going to take Delerna''s approach and try to come up with something myself....but I figured I was going to have to ask for a hint. Do you just need a good VBA book to learn what GotFocus() means, for example? My Access book has a chapter on VBA....but I''d need a listing of all the commands.... something more in depth.

I haven''t had a chance to try your idea Linq but it looks like that is the exact direction I want to go.


这篇关于如何使用向下箭头键在下拉框中滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆