如何通过单击特定的单元格或行来打开特定的表单? [英] How to open a specific form by clicking on a specific cell or row?

查看:74
本文介绍了如何通过单击特定的单元格或行来打开特定的表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Microsoft Access中,我制作了一个带有文本框和查询的表单.在文本框中写的任何内容都将显示在查询中(例如,您键入customer1,并且查询将显示具有firstname(这是列名)customer 1的所有行).
现在,我试图这样做,以便如果您双击(或单击)这些行(客户)之一,它将打开一个仅显示特定行/客户而不是所有名称为customer1的客户的表格.(例如) /p>

这也是我的查询代码:

选择*
来自客户
在哪里Forms.[Form1].[Text4]为NULL或(Forms.[Form1].[Text4] = Forms.[Form1].[Text4] AND FirstName = Forms.[Form1].[Text4]);

谢谢您的帮助.

解决方案

如果我对它的理解正确,则您有一个带有文本框和列表框(?)的表单, 1,每当文本框中发生更改时,您都希望列表框根据链接到文本框值的查询刷新显示. 2,当单击或双击列表框的行时,您要打开另一个表单,该表单具有从行值中筛选出的数据.

对于1,您可以使用文本框的事件处理程序刷新列表框的显示,对于列表框,您可以基于文本框的值对其附加查询.

对于2,您可以将事件处理程序单击"或双击"到列表框,并获取行的值,然后打开另一个预定义的表单,并使用该行的值来过滤显示.

希望有帮助.

In Microsoft Access I made a form with a textbox and a query. Whatever is written in the textbox will be shown in the query (for example you type customer1 and the query displays all rows that have firstname(this is a column name) customer 1).
Now I'm trying to make it so that if you double click (or click) one of those rows(customers) it opens a form that only shows that specific row/customer instead of all customers with name customer1(for example).

Also this is my query code :

SELECT *
FROM Customers
WHERE Forms.[Form1].[Text4] IS NULL OR (Forms.[Form1].[Text4] = Forms.[Form1].[Text4] AND FirstName=Forms.[Form1].[Text4]);

Thank you for any help.

解决方案

If I'm understanding it correctly, you have a form with a textbox and a listbox(?) on it, 1, whenever there's a change in the textbox you want the listbox to refresh the display based on the query linked to the textbox value. 2, when there's a click or double click to the row of the listbox, you want to open another form with data filtered from the row value.

for 1, you can use event handler of the text box to refresh the display of the listbox, for the listbox you can attach a query to it based on the value of the textbox.

for 2, you can have event handler of "click" or "double click" to the listbox, and get the value of the row, and then open another predefined form and using the value for the row to filter the display.

hope that helps.

这篇关于如何通过单击特定的单元格或行来打开特定的表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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