使用组合框转到选定的表单记录 [英] Using a combobox to go to a selected form record

查看:56
本文介绍了使用组合框转到选定的表单记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有一个按钮[cmdPatientfind],它位于组合框[cboPatientfind]旁边。用户从组合框中选择患者ID(整数),然后按下按钮。然后用户被带到另一个表格[frm_Patients],该表格被过滤到选定的患者ID。


然而,一旦他们查看过滤的记录,用户就无法向前或向后滚动审查周围的其他记录。有没有办法改变我的按钮后面的代码允许这个?我目前的代码如下:

展开 | 选择 | Wrap | 行号

解决方案

您的代码使用WhereCondition OpenForm命令只是将过滤器应用于窗体。为了做到你想要的,有几种方法。我更喜欢在OpenForm命令的OpenArgs参数中传递数据,然后移动到下一个表单的OnOpen事件中的右记录。


感谢提示RuralGuy。因为我是这一切的新手,你能告诉我一个代码应该如何的例子吗?


再次感谢。


< blockquote> 这实际上是一个两步过程:

  1. 在cmdPatientFind的Click()事件中,放置以下代码: />

    展开 | 选择 | Wrap | 行号


    Hello,

    I have a button [cmdPatientfind] which is beside a combo box [cboPatientfind]. The user selects the patient ID (integer) from the combo box, then presses the button. The user is then taken to another form [frm_Patients] which is filtered to the selected patient ID.

    However once they view the filtered record, the user can''t scroll forward or backward to review the other records around it. Is there a way to alter the code behind my button to allow this? The code I currently have is below:

    Expand|Select|Wrap|Line Numbers

    解决方案

    Your code uses the WhereCondition of the OpenForm command which simply applies a filter to the form. In order to do as you want there are several approaches. I prefer to pass the data in the OpenArgs argument of the OpenForm command and then move to the right record in the OnOpen event of the next form.


    Thanks for the tip RuralGuy. As I''m a newbie to all this, would you be able to show me an example of how the code should be?

    Thanks again.


    This is actually a 2 step process:

    1. In the Click() Event of cmdPatientFind, place the following code:

      Expand|Select|Wrap|Line Numbers


    这篇关于使用组合框转到选定的表单记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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