单击以进行编辑时突出显示字段(F2) [英] Highlight Field on Click for Editing (F2)

查看:79
本文介绍了单击以进行编辑时突出显示字段(F2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Access 97数据库,当转换为Access 2007时,除了发送键功能外,一切似乎都有效。我在一个表单中的on-click动作上有一个sendkeys函数,它发送F2突出显示整个字段,这样就可以完全覆盖它,而不是只是插入光标进行编辑的正常行为。有没有解决这个问题?


谢谢,


Rob

解决方案

< blockquote>早上好,欢迎来到脚本!


从Access 97转换到2007年对于胆小的人来说不是一个任务:-)


Allen Browne的网站访问提示:转换为Access 2007 是一个很好的资源,包括链接到其他非常好的资源。


那说,我不确定发送键功能,但我相信我见过一个线程就在那里的某个地方。让我来看看并回复你。


问候,

Scott


这是一个链接到MS网站讨论了Access 2007沙箱模式。显然沙箱模式将限制许多功能的可用性,其中包括SendKeys。从VBA调用时会导致错误。 http://office.microsoft.com/en-us/ ac ... 301901033.aspx

就解决方案而言,这取决于您的应用程序。一位开发人员的建议是始终开发您的应用程序以实现Access将强加的最高级别的安全限制:换句话说,不要通过减少限制来寻找方法使其工作,寻找方法重新设计,以免侵犯沙盒模式所带来的安全性。


这就是说,再次根据您的应用程序要求,您可以探索将沙盒模式重置为较低级别看看是否允许SendKeys工作。


问候,

Scott


感谢您的回复.. ..,让我们忘记安全和沙盒规则。如果我在Access 2007中编写一个打击新数据库的品牌怎么办?我如何完成以下任务。我有一个订单输入表单,其中包含某些文本框字段,单击时我想完全突出显示,因此单个按键将删除现有数据,以便输入新数据。这是击中F2会做的,但我不希望用户必须击中F2。与单击文本框字段和插入光标在单击点处闪烁的默认设置相反。也许是全选功能?如何在OnCLick下编程?功能?


谢谢,


Rob


I have an Access 97 database that when converted to Access 2007 everything seems to work except for the Send Keys function. I have a sendkeys function on the on-click action in a form that sends F2 which highlights the entire field so that it can be completely overwritten as opposed to the normal behavior of just inserting a cursor for editing. Is there a work around for this?

Thanks,

Rob

解决方案

Good morning, and welcome to the Scripts!

Converting from Access 97 to 2007 isn''t a task for the faint of heart :-)

Allen Browne''s website here Acesss Tips: Converting to Access 2007 is an excellent resource including links to other very good resources.

That said, I''m not sure about the send-keys function, but I believe I''ve seen a thread on that somewhere here. Let me take a look and get back to you.

Regards,
Scott


This is a link to MS website with a discussion of Access 2007 sandbox mode. Apparently the sandbox mode will restrict the availability of a number of functions, among which is SendKeys. It will result in an error when called from VBA. http://office.microsoft.com/en-us/ac...301901033.aspx

As far as a solution, that depends on your application. One developer''s advise is to always develop your applications for the maximum level of security restrictions that will be imposed by Access: in other words don''t look for a way to make it work by lessening the restrictions, look for a way to re-design so as to not infringe the security imposed by sandbox mode.

That said, again depending on your application requirements, you could explore resetting the sandbox mode to a lower level to see if that will allow the SendKeys to work.

Regards,
Scott


Thanks for the reply....,well let''s forget about security and sandbox rules. What if I was writing a brand spanking new DB in Access 2007? How do I accomplish the following. I have a Order Entry Form with certain text box fields that when clicked I want to completely highlight, so a single keystroke will erase the the existing data enabling to input new data. It is what hitting F2 will do, but I don''t want the user to have to hit F2. As opposed to do the default of clicking the text box field and the insert cursor blinking at the point of click. Maybe a "Select all" function? How do I program this under the "OnCLick" function?

Thanks,

Rob


这篇关于单击以进行编辑时突出显示字段(F2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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