如何使用预设查询填充组合框并显示结果 [英] how to populate a combo box with canned queries and display results

查看:58
本文介绍了如何使用预设查询填充组合框并显示结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带鹅巢数据的大桌子。鸟巢位置(河中岛屿的名称),巢类型(地面/平台),鸡蛋数量,孵化的卵数,捕食类型等等。


我有我需要报告的一些罐头查询:鸡蛋的总数,岛上的鸡蛋数量,类型的鸡蛋数量,巢的数量,岛上的巢数,类型的巢数等等。所以有一些基本的问题(总#巢,总#eggs,总巢成功,总巢失败)然后进一步过滤(以上所有按类型,位置,可能的日期范围过滤)。


我很乐意建立一个动态搜索表单,但我一直都在失败(组合框#1 =总#的...;组合框#2 =按类型/位置过滤;日期范围的第3个过滤器)。


所以现在我正在尝试构建一个包含所有这些预制查询的组合框,然后使用子表单或报表(最简单的方法)显示结果。查询不是简单的select语句,它们是总和和计数。有任何想法吗?我现在拥有的只是一个未绑定的表单,其中包含一个包含两列值列表的未绑定组合框:查询名称,查询描述。我对在组合框的更新后部分放入什么感到无能为力。


顺便说一下这是Access 2007.干杯!

I have one big fat table with goose nesting data. Things like nest location (name of island in a river), nest type (ground/platform), number of eggs, number of eggs hatched, type of predation, etc.

I have some canned queries that I need to report: total number of eggs, number of eggs by island, number of eggs by type, number of nests, number of nests by island, number of nests by type, etc. So there are a few basic questions (total # nests, total # eggs, total nest success, total nest failure) and then further filters (all of the above filtered by type, location, possibly date range).

I would LOVE to build a dynamic search form but I keep failing (combo box #1 = total # of . . .; combo box #2 = filter by type/location; 3rd filter of date range).

So now I''m trying to just build one combo box that contains all these canned queries and then have a subform or report (whatever is easiest) show the results. The queries are not simple select statements, they are sums and counts. Any ideas? All I''ve got right now is an unbound form with an unbound combo box that contains a value list of two columns: name of query, description of query. I''m clueless about what to put in the after update part of my combo box.

By the way this is Access 2007. Cheers!

推荐答案

好的,现在我在我的组合框的更新后语句中有一个运行openquery的精选案例。我想将结果显示在子表单中,而不是弹出实际查询。这是如何实现的?
Okay so now I have a select case running openquery in my after update statement of my combo box. I''d like to have the results displayed in a subform instead of popping open the actual query. How is this accomplished?


在最广泛的条件下,你会想要使用类似的东西:

In the broadest terms possible, you''ll want to use something like:

展开 | 选择 | Wrap | 行号


我为一个完整的newb道歉(我的用户名说明了一切)。我的选择案例设置有点不同。现在它看起来像这样:

I apologize for being a total newb (my username says it all). My select case is set up a bit different. Right now it looks like this:

展开 | 选择 | Wrap | 行号


这篇关于如何使用预设查询填充组合框并显示结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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