将参数从Form传递到button_click上的Query在MS Access 2013中 [英] pass parameter from the Form to the Query at the button_click In MS Access 2013

查看:148
本文介绍了将参数从Form传递到button_click上的Query在MS Access 2013中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  • 工具:MS.Access 2013

    环境: Windows 7

    • Tools: MS.Access 2013
      Environment: Windows 7

      上下文:

      我使用其中一个创建了一个名为FrmStudent的表单MS访问2013中的表("学生")以显示数据。

      I created form Called FrmStudent using one of the table ("Student") in MS access 2013 to display data .

      我还有另一个名为 的查询"qerStudentFaculty",从三个表生成查询。

      I have another query called  "qerStudentFaculty", query is generated from three tables.

      现在创建按钮,使用Macro OpenQuery调用查询打开

      Now created button to call the query to Open using Macro OpenQuery

      查询名称= qerStudentFaculty,查看=数据表数据模式=编辑

      Query Name = qerStudentFaculty, View= Datasheet Data Mode =Edit

      现在我的问题是如何从表格"FrmStudent"中传递StudentID查询"qerStudentFaculty"过滤数据。我想只有委员会中所选学生的委员会

      Now My problem is How to pass StudentID from the Form "FrmStudent " to the Query "qerStudentFaculty" to filter data. I would like to have only the faculties who are in the committee for that selected studentID

      尝试:



      • 在查询[表格]中添加参数![FrmStudent]![学生ID]

      • Adding parameter in the Query [Forms]![FrmStudent]![StudentID]

      点击按钮后会询问参数,如果我输入StudentID,它会完美过滤。

      After button click it is asking the parameters, if I enter the StudentID it filters perfectly.

      但我想要的是从表格"frmStudent"传递StudentID查询

      But I want is to pass the StudentID from the Form "frmStudent" to the query

      如何通过button_click

      How can I pass parameter from the form to the Query at the button_click

      我很感激 任何形式的帮助。

      I appreciate  any kind of help.

      谢谢

      Kanta

      推荐答案



      1. 添加参数查询[表格]![FrmStudent]![学生ID]
      2. 按钮点击后会询问参数,如果我输入学生ID,则表示过滤完美。
      3. 但我想要的是从表格"frmStudent"传递StudentID查询
      4. 如何通过button_click



      这篇关于将参数从Form传递到button_click上的Query在MS Access 2013中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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