如何编写命令按钮代码 [英] How do I code a command button

查看:145
本文介绍了如何编写命令按钮代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个附加到查询的表单。我有一个带有员工的下拉组合框,一个应该计算事件的文本框。单击计数按钮时,从查询中的类型字段开始。这需要什么代码才能工作?

I have a form that is attached to a query. I have a drop down combo box that has employees, a text box that should do a count of "incidents" from the Type field in the query when I click the count button. what is the code needed for this to work?

推荐答案

@Michael Adams


I会考虑使用myCount = DCount([What],[Where],[Criteria])。然后将文本框值设置为myCount。将代码放在按钮''上点击按钮 event。
@Michael Adams
I would look into using myCount = DCount([What], [Where], [Criteria]). Then set the textbox value to myCount. Put the code on the button''s "On Click" event.


好的,也许我没有这样做。我在按钮OnClick上输入了你告诉我的代码。然后在文本框中将我设置为myCount的默认值。当我单击按钮时,我收到此错误表单On Click您输入的事件属性设置产生了以下错误:对象不包含Automation对象''mycount''。
OK, maybe I am not doing this right. I entered the code you told me to on the buttons "OnClick" then in the text box default value I set to myCount. When I click the button I get this error "The expression On Click you entered as the event property setting produced the following error: The object doesn''t contain the Automation object ''mycount''.


@Michael Adams


Michael,

对不起,我会更具体。这是点击事件的代码:
@Michael Adams
Michael,
Sorry, I''ll be more specific. Here''s the code for the on click event:
展开 | 选择 | Wrap | 行号


这篇关于如何编写命令按钮代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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