传递参数以形成被打开

编程入门 行业动态 更新时间:2024-10-25 14:32:30
本文介绍了传递参数以形成被打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用以下代码单击Activities_Subform中的一个字段,打开Task_Subform,并将相关记录打开到Activities_Subform中的特定字段。 表单打开正常,但仅限如果我输入两个参数(objID和actID),任何人都可以告诉我代码是什么,以消除每次都要输入参数。 私有子ActivityID_Click() Dim objID As Integer Dim actID As Integer objID = ObjectiveID.Value actID = ActivityID .Value DoCmd.OpenForm" Tasks_Subform",,,"" End Sub

I am using the following code to click on a field in Activities_Subform to open the Task_Subform with the related records to the particular field in Activities_Subform. the form opens ok, but only if I put in two parameters (objID and actID), can anyone tell me what the code is to eliminate having to put in the parameters each time. Private Sub ActivityID_Click() Dim objID As Integer Dim actID As Integer objID = ObjectiveID.Value actID = ActivityID.Value DoCmd.OpenForm "Tasks_Subform", , , "" End Sub

推荐答案

我认为您需要做的就是在openform命令中添加where语句 试一试: I think all you need to do is add a where statement to your openform command Give this a try: 展开 | 选择 | Wrap | 行号

您好 谢谢,我输入了该代码我得到一个运行时错误13(类型不匹配) 任何解决方案?? Hi Thanks, I put in that code and I get a runtime error 13 (Type Mismatch) Any solutions??

对不起,你只需要添加As String即可。到行Dim strLinkCriteria 这是我的错误,对不起。 Yes sorry you just need to add "As String" to the line "Dim strLinkCriteria" That was my mistake sorry about that.

更多推荐

传递参数以形成被打开

本文发布于:2023-10-12 01:30:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483373.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!