本文介绍了你如何为逃生按钮做SendKey?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个表单以我有几个具有日期输入掩码的日期字段的形式调用报表。我创建了一个取消按钮: Private Sub btnCancel_Click() On Error GoTo Err_btnCancel_Click Dim stDocName As String DoCmd.Close Exit_btnCancel_Click: 退出Sub Err_btnCancel_Click: MsgBox Error.Description 恢复Exit_btnCancel_Click 结束子 但是如果某人已经开始在日期字段中输入日期并且没有完成日期,则会出现错误框,您必须按退出键才能清除表单,然后才能使用取消按钮。我想让我的取消按钮清除表格,然后关闭它。我以为我可以做一个sendkey命令,但我不知道怎么做。 谢谢 Dan 解决方案 I have a form that calls up a report in the form I have several date fields that have date input masks. I have created a cancel button as:Private Sub btnCancel_Click()On Error GoTo Err_btnCancel_ClickDim stDocName As String DoCmd.CloseExit_btnCancel_Click: Exit SubErr_btnCancel_Click: MsgBox Error.Description Resume Exit_btnCancel_ClickEnd SubBut if someone has started to enter a date in a date field and did not finish the date you get an error box and you have to press the escape key to clear the form before you can use the cancel button. I would like to have my cancel button clear the form and then close it. I thought I could do a sendkey command but I can''t figure out how.ThanksDan 解决方案 这篇关于你如何为逃生按钮做SendKey?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!