将交叉表查询中的字段存储在变量中 [英] Store a field from a crosstab query in a variable

查看:108
本文介绍了将交叉表查询中的字段存储在变量中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单,其中包含一个带有 值的控件,比如说Control1。



我有交叉表查询,其条件设置为仅显示具有Control1的列,以便当用户在该表单打开时运行交叉表查询时,仅显示表单上包含Control1的列。交叉表查询行是另一个参数
,交集值是总和。



我希望这个交集总和进入一个变量,我可以在表格的计算中使用它。



我一直在使用大量隐藏的表单进行计算,在计算中使用控件作为变量,然后将这些结果存储在更多表单控件中,这些控件将成为值在我的记录中。 问题是我不知道如何将
CROSSTAB QUERY作为对象引用。



我试过谷歌搜索这个和我猜你可以创建querydef对象等等,但即使我这样做,我也不知道如何定义出现在交叉表查询上的任何给定的交集和结果,特别是因为Control1是动态变化的,取决于
打开的表单。



那么......如何在开放式交叉表查询中引用此值?为什么这么复杂而烦恼gah



我对SQL或表达式一无所知,这使得它变得困难。我必须使用"构建"选项只是将交叉表查询中的条件设置为窗体上的控件,只有通过查看论坛我才知道我必须显式
使用参数按钮声明该参数。

解决方案

看起来我必须进入SQL领域才能使用表单控件,是吗?  :(

I have a form, which has a control with a value on it, let's say Control1.

I have a crosstab query which has criteria set to show only columns with Control1, such that when a user runs the crosstab query while that form is open, only the column with Control1 on the form appear. The crosstab query rows are another parameter and the intersection value is a sum.

I want this intersection sum to go into a variable, which I can use in a calculation on the form.

I've been using a lot of hidden forms for my calculations, using the controls as variables in calculations and then storing those results in more form controls which become values in my records.  Problem is that I don't know how to refer to the CROSSTAB QUERY as an object.

I tried googling this and I guess you can make querydef objects and so forth, but even if I do this, I don't know how to define any given intersection sum result appearing on that crosstab query, especially since Control1 is dynamically changing depending on the form that is open.

So... how to I refer to this value on the open crosstab query? Why is this so complicated and annoying gah

I don't know anything about SQL or expressions, too, which makes it difficult. I had to use the "Build" option just to set the criteria in the crosstab query to the control on the form, and only by looking at a forum I figured out I had to explicitly declare that parameter with the parameters button.

解决方案

It looks like I have to go into SQL territory for this one and can't just use form controls, aye?  :(


这篇关于将交叉表查询中的字段存储在变量中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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