Access Query中的变量参数 [英] Variable parameters in Access Query

查看:116
本文介绍了Access Query中的变量参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在VBA中设计一个查询,该查询将允许基于另一个变量的一个变量的容差参数。 例如:

I am trying to design a query in VBA that will allow a tolerance parameter on one variable based on another variable.  For example:

如果字段1为X,则字段2应搜索A和B之间的所有内容

If field 1 is X then field 2 should search everything between A and B

如果字段1为Y,则字段2应搜索C和D之间的所有内容...

If field 1 is Y then field 2 should search everything between C and D...

字段1强制在组合框中设置多个选项之一。 我可以在查询设计中执行between命令,但我无法弄清楚如何为字段1设置IF / Then语句。

Field one has forces one of multiple choices setup in a combo box.  I can do the between command in the query design but I can't figure out how to set of the IF/Then statement for field 1.

我有一些VBA编程经验,但我我仍然认为自己是新手。

I have some VBA programming experience, but i would still consider myself to be a novice.

推荐答案

你好,

不确定我是否清楚。字段1和字段2是否在同一个表中,您是否在同一个表中搜索字段1和字段2所在的记录?

Not sure I'm clear. Are field 1 and field 2 in the same table and are you searching records from the same table where field 1 and field 2 are also located?


这篇关于Access Query中的变量参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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