如何使用其他数据字段过滤查询? [英] How to filter query using another data field?

查看:67
本文介绍了如何使用其他数据字段过滤查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在查询的一个数据字段中的条件中使用了fgetname(),如何过滤查询?我可以再次使用查询的其他数据字段中的条件中的fgetname()吗?

I used already fgetname() in criteria in one data field of a query, how can i filter query? can i use again the fgetname() in criteria in other data field of query?

推荐答案

是的,您可以在任何需要的地方使用相同的功能。

如果您希望任何时候都有相同的结果不是问题。但是如果你希望得到不同的结果(基于你应用函数的位置),你必须稍微修改一下这个函数。
Yes you can use the same function every where you need.
If you wish the same result any time is not a problem. But if you wish different results (based from where you apply the function) you must slightly modify the function.


当我在同一个查询中使用fgetname()但是在不同的数据中时它会显示空白记录字段。


这是详细信息:在我的表单名称(home)中,我有两个组合框名称(combo238)和(combo245)。 Combo238 rowsource包含员工名称ex。 Juan,Reynulfo R.;Dela Cruz,Juan C.

而combo245 rowsource包含会计代码ex。 " 155"" 222" ;;" 223"

在查询名称(mstrquery)中,我将fgetname()放在员工条件的数据字段名称中,将另一个fgetname()放入数据字段记帐代码。当我预览主页表单并单击combo245中的一个会计代码时,当我在combo238中单击其中一个员工姓名时,我得到了相同的空白记录
It shows blank records when i used fgetname() in same query but in different data field.

This are the details: In my form name (home) i have two combobox name (combo238) and (combo245). Combo238 rowsource contains name of employees ex. "Juan, Reynulfo R.";"Dela Cruz, Juan C."
while combo245 rowsource contains accounting code ex. "155";"222";"223"
In query name (mstrquery) i put fgetname() in datafield name of employee criteria and another fgetname() to datafield accounting code. When i preview the home form and clicked one of the accounting code in combo245, i got blank record same when i clicked one of the employee name in combo238


当然。你得到了正确的结果。

因为你的函数返回相同的值。因此,您在两个字段中使用相同的值过滤查询。

我几乎可以肯定您使用单个变量来存储两个组合框中的值。这样的事情:
Of course. You obtain the correct result.
That because your function return the same value. So you filter the query with the same value in both fields.
I am almost sure that you use a single variable to store the value(s) from both combo boxes. Something like this:
展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于如何使用其他数据字段过滤查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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